diff --git a/data/fz/functions/carpet/install.mcfunction b/data/fz/functions/carpet/install.mcfunction index 206e8e9..20fc61b 100644 --- a/data/fz/functions/carpet/install.mcfunction +++ b/data/fz/functions/carpet/install.mcfunction @@ -1,5 +1,5 @@ scoreboard objectives add carpet dummy -scoreboard players reset carpet carpet +scoreboard players reset script carpet team add fakePlayer -team modify fakePlayer prefix [{"text":"假的"}] -function fz:carpet/carpet \ No newline at end of file +team modify fakePlayer prefix [{"text":"假的 "}] +function fz:carpet/script \ No newline at end of file diff --git a/data/fz/functions/carpet/scarpettagplayer.mcfunction b/data/fz/functions/carpet/scarpettagplayer.mcfunction new file mode 100644 index 0000000..52db4ed --- /dev/null +++ b/data/fz/functions/carpet/scarpettagplayer.mcfunction @@ -0,0 +1,3 @@ +execute store result score tagplayer carpet run script load tagplayer +#带标签的假玩家# +execute if score tagplayer carpet matches 0 run script run global_version = 'Version: 0.0.0-dev.20200121.0824';global_tag = 'carpetBot';global_bot_state = m();__check_offline(player_name) ->( f_player = player(player_name); if (!f_player, exit('§4假人'+player_name+'未在线'); '' ); if (!query(f_player,'has_tag',global_tag), exit('§4'+f_player+'不是假人'); '' ));__check_online(player_name) ->( f_player = player(player_name); if (f_player, if (query(f_player,'has_tag',global_tag), exit('§4假人'+f_player+'已经在线了'); '' ); exit('§4玩家'+f_player+'已经在线了'); '' ));__check_pos(x) ->( x = number(x); if(x == null, exit('§4请输入正确的坐标'); '' ); return(x));__check_tick(tick) ->( tick = number(str('%d',tick+0.5)); if(tick == null, exit('§4请输入正确的游戏刻间隔'); '' ); if(tick < 2, print(tick); exit(str('§4整数不能小于2,却发现了%d',tick)); '' ); return(tick));__check_dim(s_player,f_player) ->( if (s_player~'dimension' != f_player~'dimension', exit('§4不在同一维度!'); '' ););__player_list(i,player_list) ->( one_player_list = split(' ',join('',slice(player_list,i,i+1))); if(slice(one_player_list,0,1) == l('假的'), one_player_str = join('',slice(one_player_list,1,2)); '' ); if(slice(one_player_list,0,1) != l('假的'), one_player_str = join('',one_player_list); '' ); return(one_player_str));__on_statistic(player, category, stat, value) ->( if(query(player, 'has_tag', global_tag), if(stat == 'leave_game' && category == 'custom', modify(player, 'clear_tag', global_tag) ) ));help() ->( print('--使用帮助(/script invoke help):'); print('/script invoke summon <玩家名>\n-生成假人'); print('/script invoke kill <玩家名>\n-删除假人'); print('/script invoke killall\n-删除全部假人'); print('/script invoke tp <玩家名> \n-传送假人,可替换为“s”来代表你的位置'); print('/script invoke tp_at_<参数> <玩家名> \n-以<假人/玩家>为坐标原点传送假人'); print('/script invoke check <玩家名>\n-检查假人状态'); print('/script invoke checkall\n- 检查所有假人状态'); print('/script invoke look <玩家名> <仰俯> <偏航>\n-转动假人视角,可替换为“s”来代表你的视角方向'); print('/script invoke look_ <玩家名>\n-让假人向<上/下/东/西/南/北>方向看'); print('/script invoke turn_ <玩家名>\n-让假人向<后/左/右>方向看'); print('/script invoke move_ <玩家名>\n-让假人<向前/向后/向左/向右/停止>移动'); print('/script invoke _continuous <玩家名>\n-让假人持续<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>'); print('/script invoke _interval <玩家名> <整数>\n-让假人每<整数>游戏刻<攻击/丢一个物品/丢一组物品/跳跃/换手/使用物品一次'); print('/script invoke _once <玩家名>\n-让假人<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>一次'); print('/script invoke _stop <玩家名>\n-让假人停止<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>,如果没有动作和<参数>_once功能一致'); print('/script invoke <玩家名>\n-让假人<潜行/站立>'); print('/script invoke <玩家名>\n-让假人准备<疾跑/行走>,在水中疾跑以游泳'); print('/script invoke <玩家名>\n-让假人<乘坐/卸下>'); print('/script invoke stop <玩家名>\n-停止假人的一切动作'); print(global_version); '');summon(player_name) ->( __check_online(player_name); s_player = player(); 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); print('已为'+player_name+'添加标签和队伍'); game_tick(50); f_player = player(player_name); global_bot_state:f_player = m(); '');kill(player_name) ->( __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_str = __player_list(i,player_list); if(one_player_str == '', break() ); if(query(player(one_player_str),'has_tag',global_tag), do_fake_player = 1 ); run(str('player %s kill', one_player_str)); i += 1 ); if(do_fake_player != 1, exit('§4不存在假人'); '' ); print('已将全部假人移交§6FZ\'sDataPack§f清除标签'); game_tick(50); print('已清除全部假人'); '');attack_continuous(player_name) ->( __check_offline(player_name); run(str('player %s attack continuous', player_name)); global_bot_state:player(player_name):'attack' = '1'; '');attack_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s attack interval %d', player_name, tick)); global_bot_state:player(player_name):'attack' = tick; '');attack_once(player_name) ->( __check_offline(player_name); run(str('player %s attack once', player_name)); delete(global_bot_state:player(player_name):'attack'); '');attack_stop(player_name) ->( __check_offline(player_name); run(str('player %s attack', player_name)); delete(global_bot_state:player(player_name):'attack'); '');drop_continuous(player_name) ->( __check_offline(player_name); run(str('player %s drop continuous', player_name)); global_bot_state:player(player_name):'drop' = '1'; '');drop_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s drop interval %d', player_name, tick)); global_bot_state:player(player_name):'drop' = tick; '');drop_once(player_name) ->( __check_offline(player_name); run(str('player %s drop once', player_name)); delete(global_bot_state:player(player_name):'drop'); '');drop_stop(player_name) ->( __check_offline(player_name); run(str('player %s drop', player_name)); delete(global_bot_state:player(player_name):'drop'); '');drop_stack_continuous(player_name) ->( __check_offline(player_name); run(str('player %s dropStack continuous', player_name)); global_bot_state:player(player_name):'drop_stack' = '1'; '');drop_stack_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s dropStack interval %d', player_name, tick)); global_bot_state:player(player_name):'drop_stack' = tick; '');drop_stack_once(player_name) ->( __check_offline(player_name); run(str('player %s dropStack once', player_name)); delete(global_bot_state:player(player_name):'drop_stack'); '');drop_stack_stop(player_name) ->( __check_offline(player_name); run(str('player %s dropStack', player_name)); delete(global_bot_state:player(player_name):'drop_stack'); '');jump_continuous(player_name) ->( __check_offline(player_name); run(str('player %s jump continuous', player_name)); global_bot_state:player(player_name):'jump' = '1'; '');jump_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s jump interval %d', player_name, tick)); global_bot_state:player(player_name):'jump' = tick; '');jump_once(player_name) ->( __check_offline(player_name); run(str('player %s jump once', player_name)); delete(global_bot_state:player(player_name):'jump'); '');jump_stop(player_name) ->( __check_offline(player_name); run(str('player %s jump', player_name)); delete(global_bot_state:player(player_name):'jump'); '');swap_hands_continuous(player_name) ->( __check_offline(player_name); run(str('player %s swapHands continuous', player_name)); global_bot_state:player(player_name):'swap_hands' = '1'; '');swap_hands_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s swapHands interval %d', player_name, tick)); global_bot_state:player(player_name):'swap_hands' = tick; '');swap_hands_once(player_name) ->( __check_offline(player_name); run(str('player %s swapHands once', player_name)); delete(global_bot_state:player(player_name):'swap_hands'); '');swap_hands_stop(player_name) ->( __check_offline(player_name); run(str('player %s swapHands', player_name)); delete(global_bot_state:player(player_name):'swap_hands'); '');use_continuous(player_name) ->( __check_offline(player_name); run(str('player %s use continuous', player_name)); global_bot_state:player(player_name):'use' = '1'; '');use_interval(player_name,tick) ->( __check_offline(player_name); tick = __check_tick(tick); run(str('player %s use interval %d', player_name, tick)); global_bot_state:player(player_name):'use' = tick; '');use_once(player_name) ->( __check_offline(player_name); run(str('player %s use once', player_name)); delete(global_bot_state:player(player_name):'use'); '');use_stop(player_name) ->( __check_offline(player_name); run(str('player %s use', player_name)); delete(global_bot_state:player(player_name):'use'); '');mount(player_name) ->( __check_offline(player_name); run(str('player %s mount', player_name)); '');dismount(player_name) ->( __check_offline(player_name); run(str('player %s dismount', player_name)); '');sprint(player_name) ->( __check_offline(player_name); run(str('player %s sprint', player_name)); '');unsprint(player_name) ->( __check_offline(player_name); run(str('player %s unsprint', player_name)); '');sneak(player_name) ->( __check_offline(player_name); run(str('player %s sneak', player_name)); '');unsneak(player_name) ->( __check_offline(player_name); run(str('player %s unsneak', player_name)); '');turn_back(player_name) ->( __check_offline(player_name); run(str('player %s turn back', player_name)); '');turn_left(player_name) ->( __check_offline(player_name); run(str('player %s turn left', player_name)); '');turn_right(player_name) ->( __check_offline(player_name); run(str('player %s turn right', player_name)); '');look(player_name,x,y) ->( __check_offline(player_name); s_player = player(); if(x == 's', x = s_player~'yaw'; ); if(y == 's', y = s_player~'pitch' ); x = __check_pos(x); y = __check_pos(y); if(x > 180, x = x - 360 ); if(x < -180, x = x + 360 ); if(y > 90, y = y - 180 ); if(y < -90, y = y + 180 ); modify(player(player_name), 'yaw', x); modify(player(player_name), 'pitch', y); print(str('已将'+player_name+'的视角指向§a[%.1f,%.1f]',x,y)); '');look_up(player_name) ->( __check_offline(player_name); run(str('player %s look up', player_name)); '');look_down(player_name) ->( __check_offline(player_name); run(str('player %s look down', player_name)); '');look_east(player_name) ->( __check_offline(player_name); run(str('player %s look east', player_name)); '');look_north(player_name) ->( __check_offline(player_name); run(str('player %s look north', player_name)); '');look_south(player_name) ->( __check_offline(player_name); run(str('player %s look south', player_name)); '');look_west(player_name) ->( __check_offline(player_name); run(str('player %s look west', player_name)); '');move_backward(player_name) ->( __check_offline(player_name); run(str('player %s move backward', player_name)); global_bot_state:player(player_name):'move_vertical' = 'backward'; '');move_forward(player_name) ->( __check_offline(player_name); run(str('player %s move forward', player_name)); global_bot_state:player(player_name):'move_vertical' = 'forward'; '');move_left(player_name) ->( __check_offline(player_name); run(str('player %s move left', player_name)); global_bot_state:player(player_name):'move_transverse' = 'left'; '');move_right(player_name) ->( __check_offline(player_name); run(str('player %s move right', player_name)); global_bot_state:player(player_name):'move_transverse' = 'right'; '');move_stop(player_name) ->( __check_offline(player_name); run(str('player %s move', player_name)); delete(global_bot_state:player(player_name):'move'); '');stop(player_name) ->( __check_offline(player_name); run(str('player %s stop', player_name)); '');tp(player_name,x,y,z) ->( __check_offline(player_name); s_player = player(); f_player = player(player_name); if(x == 's', __check_dim(s_player,f_player); x = s_player~'x' ); if(y == 's', __check_dim(s_player,f_player); y = s_player~'y' ); if(z == 's', __check_dim(s_player,f_player); z = s_player~'z' ); x = __check_pos(x); y = __check_pos(y); if(y>4096, exit('§4y值不能超过4096!'); '' ); z = __check_pos(z); modify(f_player,'pos',x,y,z); print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); '');tp_at_player(player_name,x,y,z) ->( __check_offline(player_name); s_player = player(); f_player = player(player_name); __check_dim(s_player,f_player); x = s_player~'x'+__check_pos(x); y = s_player~'y'+__check_pos(y); if(y>4096, exit('§4y值不能超过4096!'); '' ); z = s_player~'z'+__check_pos(z); modify(f_player,'pos',x,y,z); print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); '');tp_at_bot(player_name,x,y,z) ->( __check_offline(player_name); f_player = player(player_name); x = f_player~'x'+__check_pos(x); y = f_player~'y'+__check_pos(y); if(y>4096, exit('§4y值不能超过4096!'); '' ); z = f_player~'z'+__check_pos(z); modify(f_player,'pos',x,y,z); print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); '');check(player_name) ->( __check_offline(player_name); f_player = player(player_name); print('假人“'+f_player+'”:'); inner_health = number(str('%d',query(f_player,'health')+0.9)); if(inner_health <= 5, inner_color = '§4'; ); if(inner_health > 5 && inner_health <= 10, inner_color = '§c'; ); if(inner_health > 10 && inner_health <= 15, inner_color = '§e'; ); if(inner_health > 15, inner_color = '§a'; ); print('- 血量:'+inner_color+inner_health); if(f_player~'dimension' == 'overworld', f_dimension = '§2主世界' ); if(f_player~'dimension' == 'the_nether', f_dimension = '§4地狱' ); if(f_player~'dimension' == 'the_end', f_dimension = '§7末地' ); print(str('- 位于:%s§a[%.2f,%.2f,%.2f]',f_dimension,f_player~'x',f_player~'y',f_player~'z')); f_yaw = f_player~'yaw'; if(f_yaw > 180, f_yaw = f_yaw - 360 ); if(f_yaw < -180, f_yaw = f_yaw + 360 ); if(f_yaw > -112.5 && f_yaw <= -67.5, f_yaw_curt = '东' ); if(f_yaw > -22.5 && f_yaw <= 22.5, f_yaw_curt = '南' ); if(f_yaw > 67.5 && f_yaw <= 112.5, f_yaw_curt = '西' ); if(f_yaw > 157.5 || f_yaw <= -157.5, f_yaw_curt = '北' ); if(f_yaw > -157.5 && f_yaw <= -112.5, f_yaw_curt = '东北' ); if(f_yaw > -67.5 && f_yaw <= -22.5, f_yaw_curt = '东南' ); if(f_yaw > 112.5 && f_yaw <= 157.5, f_yaw_curt = '西北' ); if(f_yaw > 22.5 && f_yaw <= 67.5, f_yaw_curt = '西南' ); f_pitch = f_player~'pitch'; if(f_pitch > -15 && f_pitch <= 15, f_pitch_curt = '前方' ); if(f_pitch > 15 && f_pitch <= 75, f_pitch_curt = '斜下方' ); if(f_pitch > 75 && f_pitch <= 90, f_pitch_curt = '下方' ); if(f_pitch > -75 && f_pitch <= -15, f_pitch_curt = '斜上方' ); if(f_pitch >= -90 && f_pitch <= -75, f_pitch_curt = '上方' ); print(str('- 指向:§e%s,%s§a[%.1f,%.1f]',f_yaw_curt,f_pitch_curt,f_yaw,f_pitch)); f_state = global_bot_state:f_player; inner_sneak = query(f_player,'sneaking'); inner_sprint = query(f_player,'sprinting'); inner_swim = query(f_player,'swimming'); if(f_state == m() && inner_sneak == false && inner_sprint == false, exit( print('- 无动作'); '' ) ); if(f_state:'attack' != null, if(f_state:'attack' == 1, print('- 正在疯狂输出(然并卵)或挖掘') ); if(f_state:'attack' > 1, inner_sec = f_state:'attack'/20; print('- 每'+f_state:'attack'+'游戏刻('+inner_sec+'游戏秒)尝试攻击一次') ) ); if(f_state:'drop' != null, inner_sec = f_state:'drop'/20; print('- 每'+f_state:'drop'+'游戏刻('+inner_sec+'游戏秒)扔1个物品') ); if(f_state:'drop_stack' != null, inner_sec = f_state:'drop_stack'/20; print('- 每'+f_state:'drop_stack'+'游戏刻('+inner_sec+'游戏秒)扔1组物品') ); if(f_state:'jump' != null, if(f_state:'jump' == 1, print('- 正在持续跳跃') ); if(f_state:'jump' > 1, inner_sec = f_state:'jump'/20; print('- 每'+f_state:'jump'+'游戏刻('+inner_sec+'游戏秒)尝试跳跃一次') ) ); if(f_state:'swap_hands' != null, inner_sec = f_state:'swap_hands'/20; print('- 每'+f_state:'swap_hands'+'游戏刻('+inner_sec+'游戏秒)交换一次左右手的物品') ); if(f_state:'use' != null, if(f_state:'use' == 1, print('- 正在持续使♂用物品') ); if(f_state:'use' > 1, inner_sec = f_state:'use'/20; print('- 每'+f_state:'use'+'游戏刻('+inner_sec+'游戏秒)尝试使用一次物♂品') ) ); if(f_state:'move_vertical' != null || f_state:'move_transverse' != null, if(inner_sneak == true, if(f_state:'move_vertical' == 'forward', if(f_state:'move_transverse' == 'right', print('- 正在向右前方潜行↗') ); if(f_state:'move_transverse' == 'left', print('- 正在向左前方潜行↖') ); if(f_state:'move_transverse' == null, print('- 正在向前潜行↑'); ) ); if(f_state:'move_vertical' == 'backward', if(f_state:'move_transverse' == 'right', print('- 正在向右后方潜行↘') ); if(f_state:'move_transverse' == 'left', print('- 正在向左后方潜行↙') ); if(f_state:'move_transverse' == null, print('- 正在向后潜行↓'); ) ) ); if(inner_sprint == true, if(inner_swim == true, if(f_state:'move_vertical' == 'forward', if(f_state:'move_transverse' == 'right', print('- 正在向右前方游泳↗') ); if(f_state:'move_transverse' == 'left', print('- 正在向左前方游泳↖') ); if(f_state:'move_transverse' == null, print('- 正在向前游泳↑'); ) ); if(f_state:'move_vertical' == 'backward', if(f_state:'move_transverse' == 'right', print('- 正在向右后方游泳↘') ); if(f_state:'move_transverse' == 'left', print('- 正在向左后方游泳↙') ); if(f_state:'move_transverse' == null, print('- 正在向后游泳↓'); ) ) ); if(inner_swim == false, if(f_state:'move_vertical' == 'forward', if(f_state:'move_transverse' == 'right', print('- 正在向右前方疾跑↗') ); if(f_state:'move_transverse' == 'left', print('- 正在向左前方疾跑↖') ); if(f_state:'move_transverse' == null, print('- 正在向前疾跑↑'); ) ); if(f_state:'move_vertical' == 'backward', if(f_state:'move_transverse' == 'right', print('- 正在向右后方疾跑↘§e(没错它可以开挂)') ); if(f_state:'move_transverse' == 'left', print('- 正在向左后方疾跑↙§e(没错它可以开挂)') ); if(f_state:'move_transverse' == null, print('- 正在向后疾跑↓§e(没错它可以开挂)'); ) ) ); ); if(inner_sprint == false && inner_sneak == false, if(f_state:'move_vertical' == 'forward', if(f_state:'move_transverse' == 'right', print('- 正在向右前方走↗') ); if(f_state:'move_transverse' == 'left', print('- 正在向左前方走↖') ); if(f_state:'move_transverse' == null, print('- 正在向前走↑'); ) ); if(f_state:'move_vertical' == 'backward', if(f_state:'move_transverse' == 'right', print('- 正在向右后方走↘') ); if(f_state:'move_transverse' == 'left', print('- 正在向左后方走↙') ); if(f_state:'move_transverse' == null, print('- 正在向后走↓'); ) ); ) ); if(f_state:'move_vertical' == null && f_state:'move_transverse' == null && inner_sneak == true, print('- 正在潜行') ); if(f_state:'move_vertical' == null && f_state:'move_transverse' == null && inner_sprint == true && inner_swim == false, print('- 正在原地疾跑') ); if(f_state:'move_vertical' == null && f_state:'move_transverse' == null && inner_swim == true, print('- 正在原地游泳') ); '');checkall() ->( i = 0; player_list = player('all'); loop(2147483647,,, one_player_str = __player_list(i,player_list); if(one_player_str == '', break() ); if(query(player(one_player_str),'has_tag',global_tag), check(one_player_str); do_fake_player = 1 ); i += 1 ); if(do_fake_player != 1, print('§4当前无假人') ); ''); \ No newline at end of file diff --git a/data/fz/functions/carpet/script.mcfunction b/data/fz/functions/carpet/script.mcfunction new file mode 100644 index 0000000..35af892 --- /dev/null +++ b/data/fz/functions/carpet/script.mcfunction @@ -0,0 +1,2 @@ +execute store result score script carpet run script run null +execute if score script carpet matches 1 run function fz:carpet/scarpettagplayer \ No newline at end of file diff --git a/data/fz/functions/carpet/scriptplayer.mcfunction b/data/fz/functions/carpet/scriptplayer.mcfunction new file mode 100644 index 0000000..fbb38fc --- /dev/null +++ b/data/fz/functions/carpet/scriptplayer.mcfunction @@ -0,0 +1,9 @@ +tellraw @s [{"text":"- 查看帮助:"},{"text":"/script invoke help","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke help"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 生成假人:"},{"text":"/script invoke summon 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke summon "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 删除假人:"},{"text":"/script invoke kill 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke kill "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 删除全部假人:"},{"text":"/script invoke killall","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke killall"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 传送假人:"},{"text":"/script invoke tp xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke tp "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":",xyz可替换为\"s\"来代表你的位置","color":"white"}] +tellraw @s [{"text":"- 以玩家为原点传送假人:"},{"text":"/script invoke tp_at_player xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke tp_at_player "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 以假人为原点传送假人:"},{"text":"/script invoke tp_at_bot xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke tp_at_bot "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 查看假人信息:"},{"text":"/script invoke check xxx","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke check "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 查看全部假人信息:"},{"text":"/script invoke checkall","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke checkall"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] \ No newline at end of file diff --git a/data/fz/functions/carpet/tagplayer.mcfunction b/data/fz/functions/carpet/tagplayer.mcfunction new file mode 100644 index 0000000..881d886 --- /dev/null +++ b/data/fz/functions/carpet/tagplayer.mcfunction @@ -0,0 +1,9 @@ +tellraw @s [{"text":"- 查看帮助:"},{"text":"/tagplayer","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 生成假人:"},{"text":"/tagplayer summon 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer summon "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 删除假人:"},{"text":"/tagplayer kill 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer kill "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 删除全部假人:"},{"text":"/tagplayer killall","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer killall"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 传送假人:"},{"text":"/tagplayer tp xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer tp "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":",xyz可替换为\"s\"来代表你的位置","color":"white"}] +tellraw @s [{"text":"- 以玩家为原点传送假人:"},{"text":"/tagplayer tp_at_player xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer tp_at_player "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 以假人为原点传送假人:"},{"text":"/tagplayer tp_at_bot xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer tp_at_bot "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 查看假人信息:"},{"text":"/tagplayer check xxx","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer check "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +tellraw @s [{"text":"- 查看全部假人信息:"},{"text":"/tagplayer checkall","color":"green","clickEvent":{"action":"suggest_command","value":"/tagplayer checkall"},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] \ No newline at end of file diff --git a/data/fz/functions/cleaner/cleaneron.mcfunction b/data/fz/functions/cleaner/cleaneron.mcfunction index 5d17862..a08693c 100644 --- a/data/fz/functions/cleaner/cleaneron.mcfunction +++ b/data/fz/functions/cleaner/cleaneron.mcfunction @@ -2,7 +2,7 @@ scoreboard players operation cleaner displayCleanTime = @s cleaner scoreboard players operation cleaner setCleanTime = @s cleaner scoreboard players operation cleaner setCleanTime *= 20 20 scoreboard players operation cleaner timeCounter = cleaner setCleanTime -tellraw @a [{"text":"扫地姬已开启~","color":"green"},{"score":{"objective":"displayCleanTime","name":"cleaner"},"color":"dark_aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"游戏秒后清理掉落物~","color":"yellow"}] +tellraw @a [{"selector":"@s"},{"text":"已开启扫地姬~","color":"green"},{"score":{"objective":"displayCleanTime","name":"cleaner"},"color":"dark_aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"游戏秒后清理掉落物~","color":"yellow"}] scoreboard players set cleaner cleanerBooleans 1 execute if score cleaner setCleanTime matches 5401.. run function fz:cleaner/time/5min execute if score cleaner setCleanTime matches 4801..5400 run function fz:cleaner/time/4min30s diff --git a/data/fz/functions/cleaner/cleanersoundoff.mcfunction b/data/fz/functions/cleaner/cleanersoundoff.mcfunction new file mode 100644 index 0000000..1d93b52 --- /dev/null +++ b/data/fz/functions/cleaner/cleanersoundoff.mcfunction @@ -0,0 +1,2 @@ +tag @s add noCleanerSound +tellraw @s {"text":"您已关闭扫地姬的声音提示"} \ No newline at end of file diff --git a/data/fz/functions/cleaner/cleanersoundon.mcfunction b/data/fz/functions/cleaner/cleanersoundon.mcfunction new file mode 100644 index 0000000..df20c7f --- /dev/null +++ b/data/fz/functions/cleaner/cleanersoundon.mcfunction @@ -0,0 +1,2 @@ +tag @s remove noCleanerSound +tellraw @s {"text":"您已开启扫地姬的声音提示"} \ No newline at end of file diff --git a/data/fz/functions/cleaner/install.mcfunction b/data/fz/functions/cleaner/install.mcfunction index 644ea73..850b83d 100644 --- a/data/fz/functions/cleaner/install.mcfunction +++ b/data/fz/functions/cleaner/install.mcfunction @@ -4,7 +4,7 @@ scoreboard objectives add cleanerBooleans dummy scoreboard objectives add setCleanTime dummy scoreboard objectives add displayCleanTime dummy scoreboard objectives add secondsCounter dummy -scoreboard objectives add cleanerBar trigger -scoreboard objectives add cleanerChat trigger +scoreboard objectives add cleanerMessage trigger bossbar add cleaner 1 -bossbar set cleaner max 60 \ No newline at end of file +bossbar set cleaner max 60 +scoreboard players set cleaner installed 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/subclean.mcfunction b/data/fz/functions/cleaner/subclean.mcfunction index 132faee..08a6914 100644 --- a/data/fz/functions/cleaner/subclean.mcfunction +++ b/data/fz/functions/cleaner/subclean.mcfunction @@ -11,4 +11,5 @@ execute if score cleaner setCleanTime matches 1801..2400 run function fz:cleaner execute if score cleaner setCleanTime matches 1201..1800 run function fz:cleaner/time/1min30s execute if score cleaner setCleanTime matches 601..1200 run function fz:cleaner/time/60s execute if score cleaner setCleanTime matches ..600 run function fz:cleaner/time/30s -scoreboard players operation cleaner timeCounter = cleaner setCleanTime \ No newline at end of file +scoreboard players operation cleaner timeCounter = cleaner setCleanTime +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/10s.mcfunction b/data/fz/functions/cleaner/time/10s.mcfunction index a3ab149..e3bf788 100644 --- a/data/fz/functions/cleaner/time/10s.mcfunction +++ b/data/fz/functions/cleaner/time/10s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"10","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 60 \ No newline at end of file +bossbar set cleaner value 60 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/1s.mcfunction b/data/fz/functions/cleaner/time/1s.mcfunction index de2deb6..499143a 100644 --- a/data/fz/functions/cleaner/time/1s.mcfunction +++ b/data/fz/functions/cleaner/time/1s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"1","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 10 \ No newline at end of file +bossbar set cleaner value 10 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 diff --git a/data/fz/functions/cleaner/time/2min.mcfunction b/data/fz/functions/cleaner/time/2min.mcfunction index 434529b..9493526 100644 --- a/data/fz/functions/cleaner/time/2min.mcfunction +++ b/data/fz/functions/cleaner/time/2min.mcfunction @@ -1,3 +1,4 @@ bossbar set cleaner style notched_10 bossbar set cleaner color green -bossbar set cleaner value 24 \ No newline at end of file +bossbar set cleaner value 24 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/2s.mcfunction b/data/fz/functions/cleaner/time/2s.mcfunction index 23b8acc..e4d9928 100644 --- a/data/fz/functions/cleaner/time/2s.mcfunction +++ b/data/fz/functions/cleaner/time/2s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"2","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 20 \ No newline at end of file +bossbar set cleaner value 20 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/30s.mcfunction b/data/fz/functions/cleaner/time/30s.mcfunction index fb2266e..4e87788 100644 --- a/data/fz/functions/cleaner/time/30s.mcfunction +++ b/data/fz/functions/cleaner/time/30s.mcfunction @@ -1,4 +1,5 @@ bossbar set cleaner style notched_10 bossbar set cleaner color yellow bossbar set cleaner value 6 -bossbar set cleaner visible true \ No newline at end of file +bossbar set cleaner visible true +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/3min.mcfunction b/data/fz/functions/cleaner/time/3min.mcfunction index 89c3218..571320f 100644 --- a/data/fz/functions/cleaner/time/3min.mcfunction +++ b/data/fz/functions/cleaner/time/3min.mcfunction @@ -1,3 +1,4 @@ bossbar set cleaner style notched_10 bossbar set cleaner color green -bossbar set cleaner value 36 \ No newline at end of file +bossbar set cleaner value 36 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/3s.mcfunction b/data/fz/functions/cleaner/time/3s.mcfunction index d20c7fd..8cddf3e 100644 --- a/data/fz/functions/cleaner/time/3s.mcfunction +++ b/data/fz/functions/cleaner/time/3s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"3","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 30 \ No newline at end of file +bossbar set cleaner value 30 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/4s.mcfunction b/data/fz/functions/cleaner/time/4s.mcfunction index 5cc52b8..a0a0e3e 100644 --- a/data/fz/functions/cleaner/time/4s.mcfunction +++ b/data/fz/functions/cleaner/time/4s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"4","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 40 \ No newline at end of file +bossbar set cleaner value 40 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/5min.mcfunction b/data/fz/functions/cleaner/time/5min.mcfunction index 3a5787c..9ee7467 100644 --- a/data/fz/functions/cleaner/time/5min.mcfunction +++ b/data/fz/functions/cleaner/time/5min.mcfunction @@ -1,3 +1,4 @@ bossbar set cleaner style notched_10 bossbar set cleaner color green -bossbar set cleaner value 60 \ No newline at end of file +bossbar set cleaner value 60 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/5s.mcfunction b/data/fz/functions/cleaner/time/5s.mcfunction index ca92381..d229627 100644 --- a/data/fz/functions/cleaner/time/5s.mcfunction +++ b/data/fz/functions/cleaner/time/5s.mcfunction @@ -1,4 +1,5 @@ tellraw @a[tag=!noDisplayCleanerChat] [{"text":"注意!","color":"dark_red","bold":false,"underlined":false},{"text":"5","color":"red","bold":true,"underlined":true},{"text":"游戏秒后清理掉落物~准备干活咯!","color":"dark_red","bold":false,"underlined":false}] bossbar set cleaner style notched_6 bossbar set cleaner color red -bossbar set cleaner value 50 \ No newline at end of file +bossbar set cleaner value 50 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1 \ No newline at end of file diff --git a/data/fz/functions/cleaner/time/60s.mcfunction b/data/fz/functions/cleaner/time/60s.mcfunction index 779b0a0..cc94b23 100644 --- a/data/fz/functions/cleaner/time/60s.mcfunction +++ b/data/fz/functions/cleaner/time/60s.mcfunction @@ -1,3 +1,4 @@ bossbar set cleaner style notched_10 bossbar set cleaner color yellow -bossbar set cleaner value 12 \ No newline at end of file +bossbar set cleaner value 12 +execute as @a[tag=!noCleanerSound] at @s run playsound minecraft:block.note_block.pling player @s ~ ~ ~ 1 2 \ No newline at end of file diff --git a/data/fz/functions/cleaner/trigger.mcfunction b/data/fz/functions/cleaner/trigger.mcfunction index a1e0fb2..7372921 100644 --- a/data/fz/functions/cleaner/trigger.mcfunction +++ b/data/fz/functions/cleaner/trigger.mcfunction @@ -1,17 +1,14 @@ scoreboard players enable @a cleaner -scoreboard players enable @a cleanerBar -scoreboard players enable @a cleanerChat +scoreboard players enable @a cleanerMessage execute as @a[scores={cleaner=..-1}] run function fz:cleaner/cleaneroff execute as @a[scores={cleaner=1..29}] run tellraw @s [{"text":"请输入>=30的时间(单位:秒)","color":"dark_red"}] execute as @a[scores={cleaner=30..}] run function fz:cleaner/cleaneron -execute as @a[scores={cleanerChat=1..},tag=noDisplayCleanerChat] run function fz:cleaner/cleanerchaton -execute as @a[scores={cleanerBar=1..},tag=!displayCleanerBossBar] run function fz:cleaner/cleanerbaron -execute as @a[scores={cleanerChat=..-1},tag=!noDisplayCleanerChat] run function fz:cleaner/cleanerchatoff -execute as @a[scores={cleanerBar=..-1},tag=displayCleanerBossBar] run function fz:cleaner/cleanerbaroff -scoreboard players reset @a[scores={cleanerChat=1..}] cleanerChat -scoreboard players reset @a[scores={cleanerBar=1..}] cleanerBar -scoreboard players reset @a[scores={cleanerChat=..-1}] cleanerChat -scoreboard players reset @a[scores={cleanerBar=..-1}] cleanerBar +execute as @a[scores={cleanerMessage=1},tag=noDisplayCleanerChat] run function fz:cleaner/cleanerchaton +execute as @a[scores={cleanerMessage=-1},tag=!noDisplayCleanerChat] run function fz:cleaner/cleanerchatoff +execute as @a[scores={cleanerMessage=2},tag=!displayCleanerBossBar] run function fz:cleaner/cleanerbaron +execute as @a[scores={cleanerMessage=-2},tag=displayCleanerBossBar] run function fz:cleaner/cleanerbaroff +execute as @a[scores={cleanerMessage=3},tag=noCleanerSound] run function fz:cleaner/cleanersoundon +execute as @a[scores={cleanerMessage=-3},tag=!noCleanerSound] run function fz:cleaner/cleanersoundoff scoreboard players reset @a[scores={cleaner=..-1}] cleaner scoreboard players reset @a[scores={cleaner=1..}] cleaner execute if score cleaner cleanerBooleans matches 1 run function fz:cleaner/main \ No newline at end of file diff --git a/data/fz/functions/cleaner/uninstall.mcfunction b/data/fz/functions/cleaner/uninstall.mcfunction index 7774704..2a33f9e 100644 --- a/data/fz/functions/cleaner/uninstall.mcfunction +++ b/data/fz/functions/cleaner/uninstall.mcfunction @@ -3,6 +3,5 @@ scoreboard objectives remove cleaned scoreboard objectives remove cleanerBooleans scoreboard objectives remove setCleanTime scoreboard objectives remove displayCleanTime -scoreboard objectives remove cleanerBar -scoreboard objectives remove cleanerChat +scoreboard objectives remove cleanerMessage bossbar remove cleaner \ No newline at end of file diff --git a/data/fz/functions/config/configs.mcfunction b/data/fz/functions/config/configs.mcfunction index 3ed3e58..8e88cc2 100644 --- a/data/fz/functions/config/configs.mcfunction +++ b/data/fz/functions/config/configs.mcfunction @@ -1,18 +1,18 @@ scoreboard players reset @s options function fz:noai/configs -execute if score carpet carpet matches 1.. run tellraw @s {"text":"--不计入计分板总分的假人--","color":"dark_green","bold":true} -execute if score carpet carpet matches 1.. run tellraw @s [{"text":"- 生成假人:"},{"text":"/script invoke summon 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke summon "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] -execute if score carpet carpet matches 1.. run tellraw @s [{"text":"- 删除假人:"},{"text":"/script invoke kill 玩家名","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke kill "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] -execute if score carpet carpet matches 1.. run tellraw @s [{"text":"- 删除全部假人:"},{"text":"/script invoke killall","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke kill "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] -execute if score carpet carpet matches 1.. run tellraw @s [{"text":"- 传送假人:"},{"text":"/script invoke tp xxx x y z","color":"green","clickEvent":{"action":"suggest_command","value":"/script invoke tp "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}},{"text":",xyz可替换为\"s\"来代表你的位置","color":"white"}] -tellraw @s [{"text":"--扫地姬--"}] -tellraw @s [{"text":"- 显示方式"}] -tellraw @s [{"text":" - 血条栏:"},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleanerBar set 1"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleanerBar set -1"}}] -tellraw @s [{"text":" - 指令:"},{"text":"/trigger cleanerBar set -1为关/1为开","color":"green","clickEvent":{"action":"suggest_command","value":"/trigger cleanerBar set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] -tellraw @s [{"text":" - 聊天栏:"},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleanerChat set 1"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleanerChat set -1"}}] -tellraw @s [{"text":" - 指令:"},{"text":"/trigger cleanerChat set -1为关/1为开","color":"green","clickEvent":{"action":"suggest_command","value":"/trigger cleanerChat set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] +execute if score script carpet matches 1 run tellraw @s {"text":"不计入计分板总分的假人:","color":"dark_green","bold":true} +execute if score tagplayer carpet matches 1 run function fz:carpet/tagplayer +execute unless score tagplayer carpet matches 1 run function fz:carpet/scriptplayer +tellraw @s [{"text":"扫地姬:","color":"dark_green","bold":true}] +tellraw @s [{"text":"- 提示方式"}] +tellraw @s[tag=noDisplayCleanerChat] [{"text":" - "},{"text":"聊天栏:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set 1"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +tellraw @s[tag=!noDisplayCleanerChat] [{"text":" - "},{"text":"聊天栏:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set -1"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +tellraw @s[tag=!displayCleanerBossBar] [{"text":" - "},{"text":"血条栏:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set 2"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +tellraw @s[tag=displayCleanerBossBar] [{"text":" - "},{"text":"血条栏:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set -2"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +tellraw @s[tag=noCleanerSound] [{"text":" - "},{"text":"声音:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set 3"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +tellraw @s[tag=!noCleanerSound] [{"text":" - "},{"text":"声音:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleanerMessage set -3"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] tellraw @s [{"text":"- 指令:"},{"text":"/trigger cleaner set -1为关/秒数(≥30)为开","color":"green","clickEvent":{"action":"suggest_command","value":"/trigger cleaner set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] tellraw @s [{"text":"- 预设:"},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cleaner set -1"}},{"text":"[30s]","color":"red","clickEvent":{"action":"run_command","value":"/trigger cleaner set 30"}},{"text":"[1min]","color":"gold","clickEvent":{"action":"run_command","value":"/trigger cleaner set 60"}},{"text":"[2min]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger cleaner set 120"}},{"text":"[3min]","color":"green","clickEvent":{"action":"run_command","value":"/trigger cleaner set 180"}},{"text":"[5min]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cleaner set 300"}}] -tellraw @s {"text":"--记分板--","color":"dark_green","bold":true} +tellraw @s {"text":"记分板:","color":"dark_green","bold":true} tellraw @s [{"text":"- 指令:"},{"text":"/trigger scoreSwitch set -1为关/1-9为开","color":"green","clickEvent":{"action":"suggest_command","value":"/trigger scoreSwitch set "},"hoverEvent":{"action":"show_text","value":"点击以写入聊天栏"}}] tellraw @s [{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set -1"}},{"text":"[轮播]","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 1"}},{"text":"[击杀榜]","color":"red","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 2"}},{"text":"[挖掘榜]","color":"gray","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 3"}},{"text":"[死亡榜]","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 4"}},{"text":"[交易榜]","color":"green","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 5"}},{"text":"[钓鱼榜]","color":"blue","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 6"}},{"text":"[奥里给!]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 7"}},{"text":"[活跃度]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 8"}},{"text":"[统计总量]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger scoreSwitch set 9"}}] diff --git a/data/fz/functions/config/install.mcfunction b/data/fz/functions/config/install.mcfunction index 8d0614b..8020c79 100644 --- a/data/fz/functions/config/install.mcfunction +++ b/data/fz/functions/config/install.mcfunction @@ -1 +1,2 @@ -scoreboard objectives add options trigger \ No newline at end of file +scoreboard objectives add options trigger +scoreboard players set config installed 1 \ No newline at end of file diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index 4587873..357f843 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -1,21 +1,18 @@ # @Author: Harvey.Kang # @Date: 2019-10-01 -# @Last Modified by: Harvey.Kang -# @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 # Copyright (C)2019-2020 Harvey.Kang -#升级用# -scoreboard objectives add versionMajor dummy -scoreboard objectives add versionMinor dummy -scoreboard objectives add versionPatch dummy +#升级用before# +scoreboard objectives add version dummy scoreboard players operation version version = version version -execute if score version version matches ..132 run function fz:update/before/1.3.3 +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 +execute if score versionMinor version matches 4 if score versionPatch version matches 0 if score dev1 version matches ..20200118 run function fz:update/before/1.4.0-dev +execute if score versionMinor version matches 4 if score versionPatch version matches 0 if score dev1 version matches ..20200111 unless score dev2 version matches 2241.. run function fz:update/before/1.4.0-dev5 #### 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 @@ -30,12 +27,13 @@ function fz:sleep/install function fz:cleaner/install function fz:logintips/install function fz:config/install -#升级用# -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 +#升级用after# +###1.4.0-dev2 +scoreboard players set versionMajor version 1 +scoreboard players set versionMinor version 4 +scoreboard players set versionPatch version 0 +scoreboard players set dev1 version 20200121 +scoreboard players set dev2prefix version 0 +scoreboard players set dev2 version 838 #### -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"}] \ No newline at end of file +tellraw @a [{"text":"[Datapack]"},{"text":" FZ'sDatapack-","color":"gold"},{"score":{"objective":"version","name":"versionMajor"},"color":"gold"},{"text":".","color":"gold"},{"score":{"objective":"version","name":"versionMinor"},"color":"gold"},{"text":".","color":"gold"},{"score":{"objective":"version","name":"versionPatch"},"color":"gold"},{"text":"-dev.","color":"gold"},{"score":{"objective":"version","name":"dev1"},"color":"gold"},{"text":".","color":"gold"},{"score":{"objective":"version","name":"dev2prefix"},"color":"gold"},{"score":{"objective":"version","name":"dev2"},"color":"gold"},{"text":" installed successfully","color":"gold"}] \ No newline at end of file diff --git a/data/fz/functions/logintips/install.mcfunction b/data/fz/functions/logintips/install.mcfunction index 19fae01..f21e2b8 100644 --- a/data/fz/functions/logintips/install.mcfunction +++ b/data/fz/functions/logintips/install.mcfunction @@ -1 +1 @@ -scoreboard objectives add leaveGame minecraft.custom:minecraft.leave_game \ No newline at end of file +scoreboard players set logintips installed 1 \ No newline at end of file diff --git a/data/fz/functions/logintips/main.mcfunction b/data/fz/functions/logintips/main.mcfunction index 6c31bf9..8350069 100644 --- a/data/fz/functions/logintips/main.mcfunction +++ b/data/fz/functions/logintips/main.mcfunction @@ -1,7 +1,3 @@ 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"}] -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":"以访问全部设置"}] +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 \ No newline at end of file diff --git a/data/fz/functions/logintips/uninstall.mcfunction b/data/fz/functions/logintips/uninstall.mcfunction index c49b4dd..9c43c15 100644 --- a/data/fz/functions/logintips/uninstall.mcfunction +++ b/data/fz/functions/logintips/uninstall.mcfunction @@ -1 +1 @@ -scoreboard objectives remove leaveGame \ No newline at end of file +scoreboard players reset logintips installed \ No newline at end of file diff --git a/data/fz/functions/main.mcfunction b/data/fz/functions/main.mcfunction index 2e3ac2a..a2d8353 100644 --- a/data/fz/functions/main.mcfunction +++ b/data/fz/functions/main.mcfunction @@ -1,6 +1,6 @@ -function fz:score/main -function fz:sleep/main -function fz:cleaner/trigger -function fz:logintips -function fz:noai/main -function fz:config/main \ No newline at end of file +execute if score scoreboard installed matches 1 run function fz:score/main +execute if score sleep installed matches 1 run function fz:sleep/main +execute if score cleaner installed matches 1 run function fz:cleaner/trigger +execute if score logintips installed matches 1 run function fz:logintips/main +execute if score noai installed matches 1 run function fz:noai/main +execute if score config installed matches 1 run function fz:config/main \ No newline at end of file diff --git a/data/fz/functions/noai/configs.mcfunction b/data/fz/functions/noai/configs.mcfunction index 173e54f..8910305 100644 --- a/data/fz/functions/noai/configs.mcfunction +++ b/data/fz/functions/noai/configs.mcfunction @@ -2,22 +2,26 @@ tellraw @s {"text":"--卡顿生物AI开关(本项仅op可用)--","color":"dark_green","bold":true} tellraw @s {"text":"注意!无AI的实体不会自然下落且不会因流体或实体挤压而运动!","color":"dark_red"} #除非鳕鱼ai为关否则显示关闭按钮 -execute unless data storage minecraft:cod {ai:0b} run tellraw @s [{"text":"- "},{"text":"鳕鱼[minecraft:cod]","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":" "},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:cod ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +execute unless data storage minecraft:cod {ai:0b} run tellraw @s [{"text":"- "},{"text":"鳕鱼[minecraft:cod]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:cod ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] #如果鳕鱼ai为开则显示开启按钮 -execute if data storage minecraft:cod {ai:0b} run tellraw @s [{"text":"- "},{"text":"鳕鱼[minecraft:cod]","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:cod ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +execute if data storage minecraft:cod {ai:0b} run tellraw @s [{"text":"- "},{"text":"鳕鱼[minecraft:cod]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:cod ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] #除非鲑鱼ai为关否则显示关闭按钮 -execute unless data storage minecraft:salmon {ai:0b} run tellraw @s [{"text":"- "},{"text":"鲑鱼[minecraft:salmon]","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":" "},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:salmon ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +execute unless data storage minecraft:salmon {ai:0b} run tellraw @s [{"text":"- "},{"text":"鲑鱼[minecraft:salmon]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:salmon ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] #如果鲑鱼ai为开则显示开启按钮 -execute if data storage minecraft:salmon {ai:0b} run tellraw @s [{"text":"- "},{"text":"鲑鱼[minecraft:salmon]","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:salmon ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +execute if data storage minecraft:salmon {ai:0b} run tellraw @s [{"text":"- "},{"text":"鲑鱼[minecraft:salmon]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:salmon ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] #除非热带鱼ai为关否则显示关闭按钮 -execute unless data storage minecraft:tropical_fish {ai:0b} run tellraw @s [{"text":"- "},{"text":"热带鱼[minecraft:tropical_fish]","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":" "},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:tropical_fish ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +execute unless data storage minecraft:tropical_fish {ai:0b} run tellraw @s [{"text":"- "},{"text":"热带鱼[minecraft:tropical_fish]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:tropical_fish ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] #如果热带鱼ai为开则显示开启按钮 -execute if data storage minecraft:tropical_fish {ai:0b} run tellraw @s [{"text":"- "},{"text":"热带鱼[minecraft:tropical_fish]","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:tropical_fish ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +execute if data storage minecraft:tropical_fish {ai:0b} run tellraw @s [{"text":"- "},{"text":"热带鱼[minecraft:tropical_fish]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:tropical_fish ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] #除非河豚ai为关否则显示关闭按钮 -execute unless data storage minecraft:pufferfish {ai:0b} run tellraw @s [{"text":"- "},{"text":"河豚[minecraft:pufferfish]","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":" "},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:pufferfish ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +execute unless data storage minecraft:pufferfish {ai:0b} run tellraw @s [{"text":"- "},{"text":"河豚[minecraft:pufferfish]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:pufferfish ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] #如果河豚ai为开则显示开启按钮 -execute if data storage minecraft:pufferfish {ai:0b} run tellraw @s [{"text":"- "},{"text":"河豚[minecraft:pufferfish]","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:pufferfish ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +execute if data storage minecraft:pufferfish {ai:0b} run tellraw @s [{"text":"- "},{"text":"河豚[minecraft:pufferfish]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:pufferfish ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] #除非蝙蝠ai为关否则显示关闭按钮 -execute unless data storage minecraft:bat {ai:0b} run tellraw @s [{"text":"- "},{"text":"蝙蝠[minecraft:bat]","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":" "},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:bat ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +execute unless data storage minecraft:bat {ai:0b} run tellraw @s [{"text":"- "},{"text":"蝙蝠[minecraft:bat]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:bat ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] #如果蝙蝠ai为开则显示开启按钮 -execute if data storage minecraft:bat {ai:0b} run tellraw @s [{"text":"- "},{"text":"蝙蝠[minecraft:bat]","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:bat ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +execute if data storage minecraft:bat {ai:0b} run tellraw @s [{"text":"- "},{"text":"蝙蝠[minecraft:bat]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:bat ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] +#除非兔子ai为关否则显示关闭按钮 +execute unless data storage minecraft:rabbit {ai:0b} run tellraw @s [{"text":"- "},{"text":"兔子[minecraft:rabbit]:","hoverEvent":{"action":"show_text","value":"状态:开启"}},{"text":" "},{"text":"[✔]","color":"gray","hoverEvent":{"action":"show_text","value":"已开启"}},{"text":"[✘]","color":"dark_red","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:rabbit ai set value 0b"},"hoverEvent":{"action":"show_text","value":"点击以关闭"}}] +#如果兔子ai为开则显示开启按钮 +execute if data storage minecraft:rabbit {ai:0b} run tellraw @s [{"text":"- "},{"text":"兔子[minecraft:rabbit]:","hoverEvent":{"action":"show_text","value":"状态:关闭"}},{"text":" "},{"text":"[✔]","color":"dark_green","clickEvent":{"action":"run_command","value":"/data modify storage minecraft:rabbit ai set value 1b"},"hoverEvent":{"action":"show_text","value":"点击以开启"}},{"text":" "},{"text":"[✘]","color":"gray","hoverEvent":{"action":"show_text","value":"已关闭"}}] \ No newline at end of file diff --git a/data/fz/functions/noai/install.mcfunction b/data/fz/functions/noai/install.mcfunction new file mode 100644 index 0000000..402435c --- /dev/null +++ b/data/fz/functions/noai/install.mcfunction @@ -0,0 +1 @@ +scoreboard players set noai installed 1 \ No newline at end of file diff --git a/data/fz/functions/noai/main.mcfunction b/data/fz/functions/noai/main.mcfunction index f1f4a5b..44571f2 100644 --- a/data/fz/functions/noai/main.mcfunction +++ b/data/fz/functions/noai/main.mcfunction @@ -3,8 +3,10 @@ execute if data storage minecraft:salmon {ai:0b} as @e[type=minecraft:salmon,nbt execute if data storage minecraft:tropical_fish {ai:0b} as @e[type=minecraft:tropical_fish,nbt={}] run data modify entity @s NoAI set value 1b execute if data storage minecraft:pufferfish {ai:0b} as @e[type=minecraft:pufferfish,nbt={}] run data modify entity @s NoAI set value 1b execute if data storage minecraft:bat {ai:0b} as @e[type=minecraft:bat,nbt={}] run data modify entity @s NoAI set value 1b +execute if data storage minecraft:rabbit {ai:0b} as @e[type=minecraft:rabbit,nbt={}] run data modify entity @s NoAI set value 1b execute if data storage minecraft:cod {ai:1b} as @e[type=minecraft:cod,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b execute if data storage minecraft:salmon {ai:1b} as @e[type=minecraft:salmon,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b execute if data storage minecraft:tropical_fish {ai:1b} as @e[type=minecraft:tropical_fish,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b execute if data storage minecraft:pufferfish {ai:1b} as @e[type=minecraft:pufferfish,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b -execute if data storage minecraft:bat {ai:1b} as @e[type=minecraft:bat,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b \ No newline at end of file +execute if data storage minecraft:bat {ai:1b} as @e[type=minecraft:bat,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b +execute if data storage minecraft:rabbit {ai:1b} as @e[type=minecraft:rabbit,nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b \ No newline at end of file diff --git a/data/fz/functions/noai/uninstall.mcfunction b/data/fz/functions/noai/uninstall.mcfunction new file mode 100644 index 0000000..6f5d3a9 --- /dev/null +++ b/data/fz/functions/noai/uninstall.mcfunction @@ -0,0 +1 @@ +scoreboard players reset noai installed \ No newline at end of file diff --git a/data/fz/functions/score/install.mcfunction b/data/fz/functions/score/install.mcfunction index b7a58d7..4d15aa6 100644 --- a/data/fz/functions/score/install.mcfunction +++ b/data/fz/functions/score/install.mcfunction @@ -98,4 +98,6 @@ scoreboard objectives add tFishC dummy scoreboard objectives add tTradeC dummy scoreboard objectives add tHurtC dummy scoreboard objectives add tActC dummy -#### \ No newline at end of file +#### +#安装完成 +scoreboard players set scoreboard installed 1 \ No newline at end of file diff --git a/data/fz/functions/score/main.mcfunction b/data/fz/functions/score/main.mcfunction index b2ffe3d..4e5eabf 100644 --- a/data/fz/functions/score/main.mcfunction +++ b/data/fz/functions/score/main.mcfunction @@ -52,13 +52,13 @@ execute as @a[tag=!carpetBot] unless score @s tFishC matches -2147483648..214748 execute as @a[tag=!carpetBot] unless score @s tHurtC matches -2147483648..2147483647 run scoreboard players operation @s tHurtC = @s tHurtC execute as @a[tag=!carpetBot] unless score @s tActC matches -2147483648..2147483647 run scoreboard players operation @s tActC = @s tActC #两板分数不等时运行计算函数 -execute as @a[tag=!carpetBot] unless score @s tDigC = @s digCounter run function fz:score/totalcalculator/tdigc -execute as @a[tag=!carpetBot] unless score @s tKillC = @s killCounter run function fz:score/totalcalculator/tkillc -execute as @a[tag=!carpetBot] unless score @s tDeathC = @s deathCounter run function fz:score/totalcalculator/tdeathc -execute as @a[tag=!carpetBot] unless score @s tTradeC = @s tradingCounter run function fz:score/totalcalculator/ttradec -execute as @a[tag=!carpetBot] unless score @s tFishC = @s fishingCounter run function fz:score/totalcalculator/tfishc -execute as @a[tag=!carpetBot] unless score @s tHurtC = @s damageTaken run function fz:score/totalcalculator/thurtc -execute as @a[tag=!carpetBot] unless score @s tActC = @s activation run function fz:score/totalcalculator/tactc +execute as @a unless score @s tDigC = @s digCounter run function fz:score/totalcalculator/tdigc +execute as @a unless score @s tKillC = @s killCounter run function fz:score/totalcalculator/tkillc +execute as @a unless score @s tDeathC = @s deathCounter run function fz:score/totalcalculator/tdeathc +execute as @a unless score @s tTradeC = @s tradingCounter run function fz:score/totalcalculator/ttradec +execute as @a unless score @s tFishC = @s fishingCounter run function fz:score/totalcalculator/tfishc +execute as @a unless score @s tHurtC = @s damageTaken run function fz:score/totalcalculator/thurtc +execute as @a unless score @s tActC = @s activation run function fz:score/totalcalculator/tactc #总榜在分榜中显示开=1 execute if score 总挖掘数 totalDug matches 1.. run scoreboard players operation 总挖掘数 digCounter = 总挖掘数 totalList execute if score 总击杀数 totalKilled matches 1.. run scoreboard players operation 总击杀数 killCounter = 总击杀数 totalList @@ -76,7 +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=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 +execute as @a[team=fakePlayer,tag=!carpetBot] run function fz:score/runbotdead #### \ No newline at end of file diff --git a/data/fz/functions/score/runaddprefix.mcfunction b/data/fz/functions/score/runaddprefix.mcfunction index 7b8e7b0..08633b8 100644 --- a/data/fz/functions/score/runaddprefix.mcfunction +++ b/data/fz/functions/score/runaddprefix.mcfunction @@ -1,2 +1,2 @@ team join fakePlayer @s -execute if entity @s[tag=newCarpetBot] run tellraw @a {"text":"↑假的"} \ No newline at end of file +tellraw @a {"text":"↑假的"} \ No newline at end of file diff --git a/data/fz/functions/score/runbotdead.mcfunction b/data/fz/functions/score/runbotdead.mcfunction index 0c44f07..307ddf7 100644 --- a/data/fz/functions/score/runbotdead.mcfunction +++ b/data/fz/functions/score/runbotdead.mcfunction @@ -1,4 +1,2 @@ -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 \ No newline at end of file +tellraw @a {"text":"↑真的"} \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/tactc.mcfunction b/data/fz/functions/score/totalcalculator/tactc.mcfunction index cdacb85..61da943 100644 --- a/data/fz/functions/score/totalcalculator/tactc.mcfunction +++ b/data/fz/functions/score/totalcalculator/tactc.mcfunction @@ -1,6 +1,6 @@ #计算每个玩家本游戏刻活跃度和上一游戏刻活跃度的差 scoreboard players operation @s tActC -= @s activation #将两游戏刻活跃度的差之和加在总榜上 -scoreboard players operation 总活跃时间 totalList -= @s tActC +scoreboard players operation 总活跃时间 totalList -= @s[tag=!carpetBot] tActC #储存当前游戏刻的活跃度 scoreboard players operation @s tActC = @s activation \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/tdeathc.mcfunction b/data/fz/functions/score/totalcalculator/tdeathc.mcfunction index d4bec8e..9fb2612 100644 --- a/data/fz/functions/score/totalcalculator/tdeathc.mcfunction +++ b/data/fz/functions/score/totalcalculator/tdeathc.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻死亡数和上一游戏刻死亡数的差 scoreboard players operation @s tDeathC -= @s deathCounter +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] deathCounter += @s tDeathC #将两游戏刻玩家死亡数的差之和加在总榜上 -scoreboard players operation 总死亡数 totalList -= @s tDeathC +scoreboard players operation 总死亡数 totalList -= @s[tag=!carpetBot] tDeathC #储存当前游戏刻的玩家死亡数 scoreboard players operation @s tDeathC = @s deathCounter \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/tdigc.mcfunction b/data/fz/functions/score/totalcalculator/tdigc.mcfunction index d043639..ae1bceb 100644 --- a/data/fz/functions/score/totalcalculator/tdigc.mcfunction +++ b/data/fz/functions/score/totalcalculator/tdigc.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻挖掘量和上一游戏刻挖掘量的差 scoreboard players operation @s tDigC -= @s digCounter +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] digCounter += @s tDigC #将两游戏刻玩家挖掘量的差之和加在总榜上 -scoreboard players operation 总挖掘数 totalList -= @s tDigC +scoreboard players operation 总挖掘数 totalList -= @s[tag=!carpetBot] tDigC #储存当前游戏刻的玩家挖掘量 scoreboard players operation @s tDigC = @s digCounter \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/tfishc.mcfunction b/data/fz/functions/score/totalcalculator/tfishc.mcfunction index 63f67ac..3f4313b 100644 --- a/data/fz/functions/score/totalcalculator/tfishc.mcfunction +++ b/data/fz/functions/score/totalcalculator/tfishc.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻钓鱼数和上一游戏刻钓鱼数的差 scoreboard players operation @s tFishC -= @s fishingCounter +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] fishingCounter += @s tFishC #将两游戏刻玩家钓鱼数的差之和加在总榜上 -scoreboard players operation 总钓鱼数 totalList -= @s tFishC +scoreboard players operation 总钓鱼数 totalList -= @s[tag=!carpetBot] tFishC #储存当前游戏刻的玩家钓鱼数 scoreboard players operation @s tFishC = @s fishingCounter \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/thurtc.mcfunction b/data/fz/functions/score/totalcalculator/thurtc.mcfunction index 4a49e3e..c1e7520 100644 --- a/data/fz/functions/score/totalcalculator/thurtc.mcfunction +++ b/data/fz/functions/score/totalcalculator/thurtc.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻玩家受伤害量和上一游戏刻受伤害量的差 scoreboard players operation @s tHurtC -= @s damageTaken +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] damageTaken += @s tHurtC #将两游戏刻玩家受伤害量的差之和加在总榜上 -scoreboard players operation 总受伤害量 totalList -= @s tHurtC +scoreboard players operation 总受伤害量 totalList -= @s[tag=!carpetBot] tHurtC #储存当前游戏刻的玩家受伤害量 scoreboard players operation @s tHurtC = @s damageTaken \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/tkillc.mcfunction b/data/fz/functions/score/totalcalculator/tkillc.mcfunction index 6e90d5e..dcd94eb 100644 --- a/data/fz/functions/score/totalcalculator/tkillc.mcfunction +++ b/data/fz/functions/score/totalcalculator/tkillc.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻玩家击杀数和上一游戏刻击杀数的差 scoreboard players operation @s tKillC -= @s killCounter +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] killCounter += @s tKillC #将两游戏刻玩家击杀数的差之和加在总榜上 -scoreboard players operation 总击杀数 totalList -= @s tKillC +scoreboard players operation 总击杀数 totalList -= @s[tag=!carpetBot] tKillC #储存当前游戏刻的玩家击杀数 scoreboard players operation @s tKillC = @s killCounter \ No newline at end of file diff --git a/data/fz/functions/score/totalcalculator/ttradec.mcfunction b/data/fz/functions/score/totalcalculator/ttradec.mcfunction index 43b122d..974bebb 100644 --- a/data/fz/functions/score/totalcalculator/ttradec.mcfunction +++ b/data/fz/functions/score/totalcalculator/ttradec.mcfunction @@ -1,6 +1,8 @@ #计算每个玩家本游戏刻玩家交易数和上一游戏刻交易数的差 scoreboard players operation @s tTradeC -= @s tradingCounter +#重置假人分数 +scoreboard players operation @s[tag=carpetBot] tradingCounter += @s tTradeC #将两游戏刻玩家交易数的差之和加在总榜上 -scoreboard players operation 总交易数 totalList -= @s tTradeC +scoreboard players operation 总交易数 totalList -= @s[tag=!carpetBot] tTradeC #储存当前游戏刻的玩家交易数 scoreboard players operation @s tTradeC = @s tradingCounter \ No newline at end of file diff --git a/data/fz/functions/update/before/1.3.3.mcfunction b/data/fz/functions/update/before/1.3.3.mcfunction index 544e530..7c0d1e1 100644 --- a/data/fz/functions/update/before/1.3.3.mcfunction +++ b/data/fz/functions/update/before/1.3.3.mcfunction @@ -6,14 +6,15 @@ 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 +execute if score 总挖掘数 totalList = totalDug totalList run scoreboard players reset totalDug +execute if score 总击杀数 totalList = totalKilled totalList run scoreboard players reset totalKilled +execute if score 总死亡数 totalList = totalDeath totalList run scoreboard players reset totalDeath +execute if score 总交易数 totalList = totalTraded totalList run scoreboard players reset totalTraded +execute if score 总钓鱼数 totalList = totalFished totalList run scoreboard players reset totalFished +execute if score 总受伤害量 totalList = totalHurt totalList run scoreboard players reset totalHurt +execute if score 总活跃时间 totalList = totalActivation totalList run scoreboard players reset totalActivation scoreboard objectives remove scoreswitch scoreboard objectives remove actCounter scoreboard objectives setdisplay sidebar.team.dark_purple -team remove displayScoresOff \ No newline at end of file +team remove displayScoresOff +scoreboard players reset version version \ No newline at end of file diff --git a/data/fz/functions/update/before/1.3.3d.mcfunction b/data/fz/functions/update/before/1.3.3d.mcfunction index 89aacbd..03dde3f 100644 --- a/data/fz/functions/update/before/1.3.3d.mcfunction +++ b/data/fz/functions/update/before/1.3.3d.mcfunction @@ -1,2 +1,3 @@ scoreboard objectives setdisplay sidebar.team.dark_purple -team remove displayScoresOff \ No newline at end of file +team remove displayScoresOff +scoreboard players reset version version \ No newline at end of file diff --git a/data/fz/functions/update/before/1.4.0-dev.mcfunction b/data/fz/functions/update/before/1.4.0-dev.mcfunction new file mode 100644 index 0000000..eacd06d --- /dev/null +++ b/data/fz/functions/update/before/1.4.0-dev.mcfunction @@ -0,0 +1,6 @@ +scoreboard objectives remove botDeath +scoreboard objectives remove cleanerBar +scoreboard objectives remove cleanerChat +scoreboard objectives remove versionMajor +scoreboard objectives remove versionMinor +scoreboard objectives remove versionPatch \ No newline at end of file diff --git a/data/fz/functions/update/before/1.4.0-dev5.mcfunction b/data/fz/functions/update/before/1.4.0-dev5.mcfunction new file mode 100644 index 0000000..f3ed55c --- /dev/null +++ b/data/fz/functions/update/before/1.4.0-dev5.mcfunction @@ -0,0 +1,21 @@ +scoreboard players reset 总挖掘数 totalList +scoreboard players reset 总击杀数 totalList +scoreboard players reset 总死亡数 totalList +scoreboard players reset 总交易数 totalList +scoreboard players reset 总钓鱼数 totalList +scoreboard players reset 总受伤害量 totalList +scoreboard players reset 总活跃时间 totalList +scoreboard objectives remove tActC +scoreboard objectives remove tDeathC +scoreboard objectives remove tDigC +scoreboard objectives remove tFishC +scoreboard objectives remove tHurtC +scoreboard objectives remove tKillC +scoreboard objectives remove tTradeC +scoreboard objectives add tActC dummy +scoreboard objectives add tDeathC dummy +scoreboard objectives add tDigC dummy +scoreboard objectives add tFishC dummy +scoreboard objectives add tHurtC dummy +scoreboard objectives add tKillC dummy +scoreboard objectives add tTradeC dummy \ No newline at end of file