1.4
This commit is contained in:
parent
ae50b60bfc
commit
b3b894ad7a
@ -12,8 +12,14 @@
|
||||
务必使用“/script invoke summon 玩家名”召唤假人,可以避免将他们计入记分板总分!
|
||||
务必使用“/script invoke kill 玩家名”移除假人,否则其标签无法删除!
|
||||
|
||||
v1.4
|
||||
-解决了手杀tagplayer不能删除其标签的缺陷,标签会在他们重进游戏时删除,如果使用指令再次召唤则不会删除
|
||||
-为扫地姬增加了boss血条时间提示
|
||||
-扫地姬的聊天栏和血条提示均可开关
|
||||
-tagplayer现在有“假的”前缀,避免分不清玩家列表中那些是假人
|
||||
|
||||
v1.3.3
|
||||
-添加鳕鱼、鲑鱼、热带鱼、河豚、蝙蝠的AI开关
|
||||
-添加鳕鱼、鲑鱼、热带鱼、河豚、蝙蝠的AI开关(仅1.15)
|
||||
-添加设置界面
|
||||
|
||||
v1.3.2
|
||||
|
@ -1,3 +1,5 @@
|
||||
scoreboard objectives add carpet dummy
|
||||
scoreboard players reset carpet carpet
|
||||
team add fakePlayer
|
||||
team modify fakePlayer prefix [{"text":"假的"}]
|
||||
function fz:carpet/carpet
|
1
data/fz/functions/carpet/killbot.mcfunction
Normal file
1
data/fz/functions/carpet/killbot.mcfunction
Normal file
@ -0,0 +1 @@
|
||||
|
@ -1,2 +1,2 @@
|
||||
#带标签的假玩家#
|
||||
script run __command() -> ( help() ); help() ->( print('使用帮助:'); print('/script invoke summon xxx生成玩家'); print('/script invoke kill xxx删除玩家'); print('/script invoke tp xxx x y z,传送假玩家,xyz可替换为\"s\"来代表你的位置'); print('/script invoke killall删除全部玩家'); print('tagplayer Version: 0.0.0-SNAPSHOT-20200106.2207'); '' ); __config() -> m( l('stay_loaded', true)); global_tag = 'carpetBot'; global_tag_no_bot = 'noCarpetBot'; __check_offline(player_name) ->( if (!(player (player_name)), exit('§4假人'+player_name+'未在线'); '' ); if (!query(player(player_name),'has_tag',global_tag), exit('§4'+player_name+'不是假人'); '' ); ); __check_online(player_name) ->( if (player(player_name), if (query(player(player_name),'has_tag',global_tag), exit('§4假人'+player_name+'已经在线了'); '' ); exit('§4玩家'+player_name+'已经在线了'); '' ); ); __check_pos(x) ->( x = number(x); if(x == null, exit('§4请输入正确的坐标'); '' ); return(x) ); __check_tick(tick) ->( tick = str('%d',number(tick+0.5)); if(tick == null, exit('§4请输入正确的游戏刻间隔'); '' ); if(tick < 2, exit(str('§4整数不能小于2,却发现了%d',tick)); '' ); return(tick) ); summon(player_name) ->( s_player = player(); player_name = replace(player_name, '\\s',''); __check_online(player_name); run(str('player %s spawn at %f %f %f', player_name, s_player~'x', s_player~'y', s_player~'z')); if (!(player(player_name)), exit('§4生成失败') ); if(query(player(player_name),'has_tag',global_tag_no_bot), modify(player(player_name),'clear_tag',global_tag_no_bot) ); modify(player(player_name), 'tag', global_tag); print('已为'+player_name+'添加标签 '); '' ); kill(player_name) ->( player_name = replace(player_name, '\\s',''); __check_offline(player_name); modify(player(player_name), 'tag', global_tag_no_bot); print('已将'+player(player_name)+'移交§6FZ\'sDataPack§f清除标签'); run(str('player %s kill', player_name)); game_tick(50); if(player(player_name), exit( modify(player(player_name), 'tag', global_tag); print('§4清除失败'); print('已重新添加'+player_name+'的标签'); '' ); ); print('已清除'+player_name); '' ); killall() ->( i = 0; player_list = player('all'); loop(2147483647,,, one_player = slice(player_list,i,i+1); one_player_str = join('',one_player); if(one_player_str=='', break() ); if(query(player(one_player_str),'has_tag',global_tag), do_fake_player = 1; modify(player(one_player_str), 'tag', global_tag_no_bot) );run(str('player %s kill', one_player_str)); i = i+1; ); if(do_fake_player != 1, exit('§4不存在假人'); '' ); print('已将全部假人移交§6FZ\'sDataPack§f清除标签'); game_tick(50); print('已清除全部假人'); '' ); tp(player_name,x,y,z) ->( __check_offline(player_name); s_player = player(); if(x == 's', x = s_player~'x' ); if(y == 's', y = s_player~'y' ); if(z == 's', z = s_player~'z' ); x = __check_pos(x); y = __check_pos(y); z = __check_pos(z); run(str('tp %s %f %f %f', player_name, x, y, z)); '' );
|
||||
script run __command() -> ( help());__config() -> m( l('stay_loaded', true)); global_version = 'Version: 0.0.0-SNAPSHOT-dev.20200109.1737';global_tag = 'carpetBot';global_new_bot = 'newCarpetBot';__check_offline(player_name) ->( if (!(player (player_name)), exit('§4假人'+player_name+'未在线'); '' ); if (!query(player(player_name),'has_tag',global_tag), exit('§4'+player_name+'不是假人'); '' ););__check_online(player_name) ->( if (player(player_name), if (query(player(player_name),'has_tag',global_tag), exit('§4假人'+player_name+'已经在线了'); '' ); exit('§4玩家'+player_name+'已经在线了'); '' ););__check_pos(x) ->( x = number(x); if(x == null, exit('§4请输入正确的坐标'); '' ); return(x));__check_tick(tick) ->( tick = str('%d',number(tick+0.5)); if(tick == null, exit('§4请输入正确的游戏刻间隔'); '' ); if(tick < 2, exit(str('§4整数不能小于2,却发现了%d',tick)); '' ); return(tick));help() ->( print('使用帮助:'); print('/script invoke summon xxx 生成假人'); print('/script invoke kill xxx 删除假人'); print('/script invoke killall 删除全部假人'); print('/script invoke tp xxx x y z 传送假玩家,xyz可替换为\"s\"来代表你的位置'); print(global_version); '');summon(player_name) ->( s_player = player(); player_name = replace(player_name, '\\s',''); __check_online(player_name); run(str('player %s spawn at %f %f %f', player_name, s_player~'x', s_player~'y', s_player~'z')); if (!(player(player_name)), exit('§4生成失败') ); modify(player(player_name), 'tag', global_tag); modify(player(player_name), 'tag', global_new_bot); print('已为'+player_name+'添加标签和队伍'); game_tick(50); modify(player(player_name), 'clear_tag', global_new_bot); '');kill(player_name) ->( player_name = replace(player_name, '\\s',''); __check_offline(player_name); run(str('player %s kill', player_name)); game_tick(50); print('已清除'+player_name); '');killall() ->( i = 0; player_list = player('all'); loop(2147483647,,, one_player = slice(player_list,i,i+1); one_player_str = join('',one_player); if(one_player_str=='', break() ); if(query(player(one_player_str),'has_tag',global_tag), do_fake_player = 1; ); modify(player(one_player_str), 'tag', global_tag_no_bot); run(str('player %s kill', one_player_str)); i = i+1; ); if(do_fake_player != 1, exit('§4不存在假人'); '' ); print('已将全部假人移交§6FZ\'sDataPack§f清除标签'); game_tick(50); print('已清除全部假人'); '');tp(player_name,x,y,z) ->( __check_offline(player_name); s_player = player(); if(x == 's', x = s_player~'x' ); if(y == 's', y = s_player~'y' ); if(z == 's', z = s_player~'z' ); x = __check_pos(x); y = __check_pos(y); z = __check_pos(z); run(str('tp %s %f %f %f', player_name, x, y, z)); '');
|
||||
|
1
data/fz/functions/carpet/summonbot.mcfunction
Normal file
1
data/fz/functions/carpet/summonbot.mcfunction
Normal file
@ -0,0 +1 @@
|
||||
|
@ -1 +1,2 @@
|
||||
scoreboard objectives remove carpet
|
||||
scoreboard objectives remove carpet
|
||||
team remove fakePlayer
|
1
data/fz/functions/condition.mcfunction
Normal file
1
data/fz/functions/condition.mcfunction
Normal file
@ -0,0 +1 @@
|
||||
execute if score installed installed matches 1 run function fz:main
|
@ -4,15 +4,20 @@
|
||||
# @Last Modified time: 2019-12-15 03:53:27
|
||||
# @License: GNU General Public License, version 3 (GPL-3.0)
|
||||
|
||||
# This project is licensed under the terms of the GNU General Public License v3.0.
|
||||
# This project is licensed under the terms of the GNU General Public License v3.0
|
||||
# Copyright (C)2019-2020 Harvey.Kang
|
||||
#升级用#
|
||||
scoreboard objectives add version dummy
|
||||
scoreboard objectives add versionMajor dummy
|
||||
scoreboard objectives add versionMinor dummy
|
||||
scoreboard objectives add versionPatch dummy
|
||||
scoreboard players operation version version = version version
|
||||
execute if score version version matches ..132 run function fz:updatebeforeinstall133
|
||||
execute if score version version matches 133 run function fz:updatebeforeinstall134
|
||||
execute if score version version matches ..132 run function fz:update/before/1.3.3
|
||||
execute if score version version matches 133 run function fz:update/before/1.3.3d
|
||||
####
|
||||
scoreboard objectives add installed dummy
|
||||
scoreboard players set installed installed 1
|
||||
gamerule disableElytraMovementCheck true
|
||||
scoreboard objectives add leaveGame minecraft.custom:minecraft.leave_game
|
||||
scoreboard objectives add timeCounter dummy
|
||||
scoreboard objectives add 20 dummy
|
||||
scoreboard objectives add 1 dummy
|
||||
@ -26,8 +31,11 @@ function fz:cleaner/install
|
||||
function fz:logintips/install
|
||||
function fz:config/install
|
||||
#升级用#
|
||||
execute if score installed installed matches ..132 run function fz:updateafterinstall133
|
||||
execute if score installed installed matches 133 run function fz:updateafterinstall134
|
||||
scoreboard players set version version 1331
|
||||
execute if score version version matches ..132 run function fz:update/after/1.3.3
|
||||
execute if score version version matches 133 run function fz:update/after/1.3.3d
|
||||
function fz:update/after/1.4
|
||||
scoreboard players set version versionMajor 1
|
||||
scoreboard players set version versionMinor 4
|
||||
scoreboard players set version versionPatch 0
|
||||
####
|
||||
tellraw @a [{"text":"[Datapack]"},{"text":" FZ'sDataPack v1.3.3 installed successfully","color":"gold"}]
|
||||
tellraw @a [{"text":"[Datapack]"},{"text":" FZ'sDatapack-","color":"gold"},{"score":{"objective":"versionMajor","name":"version"},"color":"gold"},{"text":".","color":"gold"},{"score":{"objective":"versionMinor","name":"version"},"color":"gold"},{"text":".","color":"gold"},{"score":{"objective":"versionPatch","name":"version"},"color":"gold"},{"text":"-dev.20200109.1743 installed successfully","color":"gold"}]
|
9
data/fz/functions/logintips.mcfunction
Normal file
9
data/fz/functions/logintips.mcfunction
Normal file
@ -0,0 +1,9 @@
|
||||
execute as @a unless score @s leaveGame matches -2147483648..2147483647 run scoreboard players operation @s leaveGame = @s leaveGame
|
||||
tellraw @a[scores={leaveGame=0..}] [{"text":"使用"},{"text":"/trigger cleaner set -1或≥30(单位:秒)","underlined":true,"clickEvent":{"action":"suggest_command","value":"/trigger cleaner set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"来关/开扫地姬"}]
|
||||
tellraw @a[scores={leaveGame=0..}] [{"text":"使用"},{"text":"/trigger scoreswitch set -1或1-9","underlined":true,"clickEvent":{"action":"suggest_command","value":"/trigger scoreswitch set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"来关/开记分板"}]
|
||||
execute if score carpet carpet matches 1.. run tellraw @a[scores={leaveGame=0..}] [{"text":"务必使用","color":"dark_red"},{"text":"/script invoke summon 玩家名","underlined":true,"color":"red","clickEvent":{"action":"suggest_command","value":"/script invoke summon "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"召唤假人,可以避免将他们计入记分板总分!","color":"dark_red"}]
|
||||
execute if score carpet carpet matches 1.. run tellraw @a[scores={leaveGame=0..}] [{"text":"务必使用","color":"dark_red"},{"text":"/script invoke kill 玩家名","underlined":true,"color":"red","clickEvent":{"action":"suggest_command","value":"/script invoke kill "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"删除假人,否则其标签无法删除!","color":"dark_red"}]
|
||||
execute if score carpet carpet matches 1.. run tellraw @a[scores={leaveGame=0..}] [{"text":"使用"},{"text":"/script invoke tp 玩家名 x y z","underlined":true,"clickEvent":{"action":"suggest_command","value":"/script invoke tp "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"传送假人,用\"s\"代替坐标可表示玩家位置"}]
|
||||
execute if score carpet carpet matches 1.. run tellraw @a[scores={leaveGame=0..}] [{"text":"使用"},{"text":"/script invoke kill 玩家名","underlined":true,"clickEvent":{"action":"suggest_command","value":"/script invoke killall"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":"删除全部假人"}]
|
||||
tellraw @a[scores={leaveGame=0..}] [{"text":"使用","color":"gold"},{"text":"/trigger options","underlined":true,"clickEvent":{"action":"run_command","value":"/trigger options"},"hoverEvent":{"action":"show_text","value":"点击以访问全部设置"}},{"text":"以访问全部设置"}]
|
||||
scoreboard players set @a[scores={leaveGame=0..}] leaveGame -1
|
@ -1,6 +1,6 @@
|
||||
function fz:score/main
|
||||
function fz:sleep/main
|
||||
function fz:cleaner/trigger
|
||||
function fz:logintips/main
|
||||
function fz:logintips
|
||||
function fz:noai/main
|
||||
function fz:config/main
|
@ -8,6 +8,7 @@ scoreboard objectives add damageTaken minecraft.custom:minecraft.damage_taken
|
||||
scoreboard objectives add actCounter minecraft.custom:minecraft.play_one_minute
|
||||
scoreboard objectives add totalList dummy
|
||||
scoreboard objectives add activation dummy
|
||||
scoreboard objectives add botDeath deathCount
|
||||
####
|
||||
#编辑记分项目#
|
||||
scoreboard objectives modify digCounter displayname {"text":"挖掘榜","color":"gray"}
|
||||
@ -17,7 +18,7 @@ scoreboard objectives modify tradingCounter displayname {"text":"PY榜","color":
|
||||
scoreboard objectives modify fishingCounter displayname {"text":"钓鱼榜","color":"blue"}
|
||||
scoreboard objectives modify damageTaken displayname [{"text":"奥利给榜","color":"yellow"},{"text":"(受伤害*10)","color":"gole"}]
|
||||
scoreboard objectives modify totalList displayname {"text":"统计总量","color":"light_purple"}
|
||||
scoreboard objectives modify activation displayname [{"text":"活跃度排行","color":"aqua"},{"text":"(小时)","color":"gold"}]
|
||||
scoreboard objectives modify activation displayname [{"text":"活跃度排行","color":"aqua"},{"text":"(小时)","color":"gold"}]
|
||||
####
|
||||
#安装工具项目#
|
||||
scoreboard objectives add diamond_pickaxe minecraft.used:minecraft.diamond_pickaxe
|
||||
|
@ -1,5 +1,6 @@
|
||||
#活跃度模块#
|
||||
execute as @a[tag=!carpetBot] if score @s actCounter matches 72000.. run function fz:score/activationcarry
|
||||
execute as @a[tag=carpetBot] run scoreboard players operation @s actCounter -= 1 1
|
||||
####
|
||||
#记分板循环#
|
||||
scoreboard players add scoreboard timeCounter 1
|
||||
@ -75,6 +76,7 @@ execute if score 总活跃时间 totalActivation matches 1.. run scoreboard play
|
||||
#execute if score totalHurt totalHurt matches ..0 run function fz:score/totalnodisplay/damagetaken
|
||||
#execute if score totalActivation totalActivation matches ..0 run function fz:score/activation/totalnodisplay
|
||||
####
|
||||
#假人清理模块#
|
||||
execute as @a[tag=noCarpetBot] run function fz:score/removebottag
|
||||
#假人模块#
|
||||
execute as @a[tag=carpetBot,team=!fakePlayer] run function fz:score/runaddprefix
|
||||
execute as @a[tag=carpetBot,tag=!newCarpetBot] if score @s leaveGame matches 0 run function fz:score/runbotdead
|
||||
####
|
2
data/fz/functions/score/runaddprefix.mcfunction
Normal file
2
data/fz/functions/score/runaddprefix.mcfunction
Normal file
@ -0,0 +1,2 @@
|
||||
team join fakePlayer @s
|
||||
execute if entity @s[tag=newCarpetBot] run tellraw @a {"text":"↑假的"}
|
4
data/fz/functions/score/runbotdead.mcfunction
Normal file
4
data/fz/functions/score/runbotdead.mcfunction
Normal file
@ -0,0 +1,4 @@
|
||||
tag @s remove carpetBot
|
||||
team leave @s
|
||||
execute if score @s botDeath matches 1.. run scoreboard players operation @s deathCounter -= 1 1
|
||||
execute if score @s botDeath matches 1.. run scoreboard players reset @s botDeath
|
@ -8,6 +8,9 @@ scoreboard objectives setdisplay sidebar.team.blue
|
||||
scoreboard objectives setdisplay sidebar.team.yellow
|
||||
scoreboard objectives setdisplay sidebar.team.light_purple
|
||||
####
|
||||
#移除记分板#
|
||||
scoreboard objectives remove botDeath
|
||||
####
|
||||
#移除工具项目#
|
||||
scoreboard objectives remove diamond_pickaxe
|
||||
scoreboard objectives remove diamond_axe
|
||||
|
@ -1,6 +1,8 @@
|
||||
scoreboard objectives remove timeCounter
|
||||
scoreboard objectives remove 20
|
||||
scoreboard objectives remove version
|
||||
scoreboard objectives remove leaveGame
|
||||
scoreboard objectives remove installed
|
||||
function fz:carpet/uninstall
|
||||
function fz:health/uninstall
|
||||
function fz:sleep/uninstall
|
||||
|
1
data/fz/functions/update/after/1.4.mcfunction
Normal file
1
data/fz/functions/update/after/1.4.mcfunction
Normal file
@ -0,0 +1 @@
|
||||
scoreboard objectives remove version
|
19
data/fz/functions/update/before/1.3.3.mcfunction
Normal file
19
data/fz/functions/update/before/1.3.3.mcfunction
Normal file
@ -0,0 +1,19 @@
|
||||
scoreboard objectives remove installed
|
||||
scoreboard players operation 总挖掘数 totalList = totalDug totalList
|
||||
scoreboard players operation 总击杀数 totalList = totalKilled totalList
|
||||
scoreboard players operation 总死亡数 totalList = totalDeath totalList
|
||||
scoreboard players operation 总交易数 totalList = totalTraded totalList
|
||||
scoreboard players operation 总钓鱼数 totalList = totalFished totalList
|
||||
scoreboard players operation 总受伤害量 totalList = totalHurt totalList
|
||||
scoreboard players operation 总活跃时间 totalList = totalActivation totalList
|
||||
scoreboard players reset totalDug
|
||||
scoreboard players reset totalKilled
|
||||
scoreboard players reset totalDeath
|
||||
scoreboard players reset totalTraded
|
||||
scoreboard players reset totalFished
|
||||
scoreboard players reset totalHurt
|
||||
scoreboard players reset totalActivation
|
||||
scoreboard objectives remove scoreswitch
|
||||
scoreboard objectives remove actCounter
|
||||
scoreboard objectives setdisplay sidebar.team.dark_purple
|
||||
team remove displayScoresOff
|
2
data/fz/functions/update/before/1.3.3d.mcfunction
Normal file
2
data/fz/functions/update/before/1.3.3d.mcfunction
Normal file
@ -0,0 +1,2 @@
|
||||
scoreboard objectives setdisplay sidebar.team.dark_purple
|
||||
team remove displayScoresOff
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"values": [
|
||||
"fz:main"
|
||||
"fz:condition"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user