This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
3 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |