我的世界公告栏指令
1.设置文字
/scoreboard objectives remove 信息栏
/scoreboard objectives add 信息栏 dummy "自行更改这里面的文字"
/scoreboard objectives setdisplay sidebar 信息栏 ascending
/scoreboard players set "§7---------§r" 信息栏 -6
/scoreboard players set "§o§bঌ§l§f ɴᴏᴛɪᴄᴇ ɪɴғᴏ" 信息栏 -5
/scoreboard players set " §7[§b服主§7] 可自行更改" 信息栏 -4
/scoreboard players set " §7[§d交流§7] 955371784" 信息栏 -2
/scoreboard players set "§o§bঌ§l§f ᴏɴʟɪɴᴇ ɪɴғᴏ" 信息栏 -1
/scoreboard players set "§7---------" 信息栏 999
2.检测数量
/scoreboard players set " §d●§7 在线人数" 信息栏 0
/execute as @a run scoreboard players add " §d●§7 在线人数" 信息栏 1
/scoreboard players set " §c●§7 实体数量" 信息栏 0
/execute as @e[type=!player,type=!item] run scoreboard players add " §c●§7 实体数量" 信息栏 1
/scoreboard players set " §a●§7 掉落物数" 信息栏 0
/execute as @e[type=item] run scoreboard players add " §a●§7 掉落物数" 信息栏 1
/scoreboard players set " §b●§7 在线OP数" 信息栏 0
/execute as @a[m=1] run scoreboard players add " §b●§7 在线OP数" 信息栏 1
3.清理掉落物和实体数量
/scoreboard players remove " §e●§7 定时清理" 信息栏 1 延迟20,循环无条件红石开启
/execute if score " §e●§7 定时清理" 信息栏 matches 11 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §710秒后清除掉落物,请保管好自己的物品!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 10 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §410!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 9 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §49!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 8 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §48!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 8 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §47!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 6 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §46!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 5 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §45!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 4 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §44!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 3 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §43!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 2 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §42!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 1 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §41!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 0 run tellraw @a {"rawtext":[{"text":"§a●§f〉 §b掉落物已经被清理我跑路了!"}]}
/execute if score " §e●§7 定时清理" 信息栏 matches 0 run playsound item.trident.riptide_3 @a
/execute if score " §e●§7 定时清理" 信息栏 matches 0 run kill @e[type=item]
/execute if score " §e●§7 定时清理" 信息栏 matches ..0 run scoreboard players set " §e●§7 定时清理" 信息栏 120
/execute if score " §c●§7 实体数量" 信息栏 matches 500..
/execute if score "§c●§7 实体数量" 信息栏 matches 500.. run tp @e[type=!player,type=!npc,type=!armor_stand,type=!painting,type=!villager,type=!zombie_villager,type=!iron_golem,type=!snow_golem,type=!wolf,type=!cat,type=!zombie_horse,type=!skeleton_horse,type=!leash_knot,type=!ender_dragon,type=!ender_crystal,type=!minecart,type=!hopper_minecart,type=!chest_minecart,type=!thrown_trident,name=!宠物] ~ -999 ~
/gamerule commandBlockOutput false
4.在线奖励
/scoreboard players remove " §6●§7 在线奖励" 信息栏 1 延迟20循环无条件红石开启
/execute if score " §6●§7 在线奖励" 信息栏 matches 0 run tellraw @a {"rawtext":[{"text":"§6●§f〉§7 已发放 §n曲奇 §7* §f10"}]}
/execute if score " §6●§7 在线奖励" 信息栏 matches 0 run give @a cookie 10
/execute if score " §6●§7 在线奖励" 信息栏 matches 0 run playsound mob.chicken.plop @a
/execute if score " §6●§7 在线奖励" 信息栏 matches ..0 run scoreboard players set " §6●§7 在线奖励" 信息栏 999
