Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
[Fix] Change var to low case
Browse files Browse the repository at this point in the history
1. Because mcfunction is strict on variables, it needs to be case sensitive to avoid variable errors
2. Change announce message
3. Change time delay from 100 to 50, from 200 to 100
  • Loading branch information
Ecss11 committed Jul 27, 2020
1 parent 9062ab2 commit 50dcb91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion data/ruaserver/functions/announce/install.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 创建两个计分板检测退出次数和在线时间
scoreboard objectives add logout minecraft.custom:leave_game
scoreboard objectives add Online minecraft.custom:play_one_minute
scoreboard objectives add online minecraft.custom:play_one_minute
16 changes: 8 additions & 8 deletions data/ruaserver/functions/announce/main.mcfunction
Original file line number Diff line number Diff line change
@@ -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
# 在线时间为 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
4 changes: 2 additions & 2 deletions data/ruaserver/functions/announce/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 删除 Logout 和 online 两个计分板
scoreboard objectives remove Logout
scoreboard objectives remove Online
scoreboard objectives remove logout
scoreboard objectives remove online

0 comments on commit 50dcb91

Please sign in to comment.