适用版本:
Minecraft 1.12.2(由于命令格式不同,其他版本可能不兼容)
可在存档或服务器中使用(如果服务器不能加插件的话)
欢迎语只有目标玩家自己看到(把 @s 改成 @a 的话全部玩家都能看到)
关闭命令方块输出:
/gamerule commandBlockOutput false
创建计分板:
/scoreboard objectives add CountLeaveGame stat.leaveGame 离开游戏次数
/scoreboard objectives add CountPlayedTime stat.playOneMinute 游玩时长
命令方块:
execute @a[score_CountPlayedTime=100] ~ ~ ~ tellraw @s {"text":"初次入服欢迎语"}
execute @a[score_CountPlayedTime=100] ~ ~ ~ scoreboard players set @s CountPlayedTime 200
execute @a[score_CountPlayedTime_min=100,score_CountLeaveGame_min=1] ~ ~ ~ tellraw @s {"text":"欢迎语"}
execute @a[score_CountPlayedTime_min=100,score_CountLeaveGame_min=1] ~ ~ ~ scoreboard players set @s CountLeaveGame 0
tellraw:
/tellraw @s ["",{"text":"你好,","bold":true,"color":"yellow"},{"selector":"@s","bold":true,"color":"green"},{"text":"!","bold":true,"color":"yellow"},{"text":"欢迎回来~","bold":true,"color":"light_purple"}]
辅助工具:
www.minecraftjson.com