diff --git a/data/ruaserver/functions/announce/install.mcfunction b/data/ruaserver/functions/announce/install.mcfunction index 7ad5250..7669efb 100644 --- a/data/ruaserver/functions/announce/install.mcfunction +++ b/data/ruaserver/functions/announce/install.mcfunction @@ -1,3 +1,3 @@ # 创建两个计分板检测退出次数和在线时间 scoreboard objectives add logout minecraft.custom:leave_game -scoreboard objectives add Online minecraft.custom:play_one_minute \ No newline at end of file +scoreboard objectives add online minecraft.custom:play_one_minute \ No newline at end of file diff --git a/data/ruaserver/functions/announce/main.mcfunction b/data/ruaserver/functions/announce/main.mcfunction index dde9341..b19f798 100644 --- a/data/ruaserver/functions/announce/main.mcfunction +++ b/data/ruaserver/functions/announce/main.mcfunction @@ -1,9 +1,9 @@ -# 在线时间为 100 后显示通知 -execute as @a[scores={Online=100}] at @s run tellraw @s [{"text":"欢迎来到RUA服务器,这使你充满了决心","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"clickEvent":{"action":"open_url","value":"https://ruabbs.com"},"hoverEvent":{"action":"show_text","value":"点击此处打开 RUA 论坛"}}] -# 设置在线时间为 200 避免多次显示 -execute as @a[scores={Online=100}] at @s run scoreboard players set @s Online 200 +# 在线时间为 50 后显示通知 +execute as @a[scores={online=50}] at @s run tellraw @s [{"text":"欢迎来到rua服务器, ","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"点我进入论坛","color":"aqua","bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"clickEvent":{"action":"open_url","value":"https://ruabbs.com"}}] +# 设置在线时间为 100 避免多次显示 +execute as @a[scores={online=50}] at @s run scoreboard players set @s online 100 -# 在线时间为 100 或更大,并且退出过一次或更多次服务器,则显示通知 -execute as @a[scores={Online=100.., Logout=1..}] at @s run tellraw @s [{"text":"欢迎来到RUA服务器,这使你充满了决心","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"clickEvent":{"action":"open_url","value":"https://ruabbs.com"},"hoverEvent":{"action":"show_text","value":"点击此处打开 RUA 论坛"}}] -# 重置退出次数为 0,所以为什么要设置退出一次或更多啊233 -execute as @a[scores={Online=100.., Logout=1..}] at @s run scoreboard players set @s Logout 0 \ No newline at end of file +# 在线时间为 50 或更大,并且退出过一次或更多次服务器,则显示通知 +execute as @a[scores={logout=1}] at @s run tellraw @s [{"text":"欢迎来到rua服务器, ","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"点我进入论坛","color":"aqua","bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"clickEvent":{"action":"open_url","value":"https://ruabbs.com"}}] +# 重置退出次数为 0 +execute as @a[scores={logout=1}] at @s run scoreboard players reset @s logout \ No newline at end of file diff --git a/data/ruaserver/functions/announce/uninstall.mcfunction b/data/ruaserver/functions/announce/uninstall.mcfunction index 33371c5..1b81efb 100644 --- a/data/ruaserver/functions/announce/uninstall.mcfunction +++ b/data/ruaserver/functions/announce/uninstall.mcfunction @@ -1,3 +1,3 @@ # 删除 Logout 和 online 两个计分板 -scoreboard objectives remove Logout -scoreboard objectives remove Online \ No newline at end of file +scoreboard objectives remove logout +scoreboard objectives remove online \ No newline at end of file