Просмотр исходного кода

使用 $countdown 作为土豆计时

LTCatt 6 лет назад
Родитель
Сommit
a7c6a2c88a

+ 1 - 3
data/mini/functions/hotpm/init.mcfunction

@@ -1,3 +1 @@
-# 如果要使用记分板,在这里添加
-scoreboard objectives remove hotpm_timer
-scoreboard objectives add hotpm_timer dummy ["土豆计时器"]
+# 似乎这个也不需要初始化什么

+ 2 - 2
data/mini/functions/hotpm/pm_init.mcfunction

@@ -5,7 +5,7 @@ tag @a[tag=hpm_holding] remove hpm_holding
 execute as @r[tag=mini_running] run function mini:hotpm/pm_get
 
 #告知玩家
-tellraw @a [{"text":">> ","color":"gold"},{"selector":"@a[tag=hpm_holding]","color":"yellow"},{"text":"获得了土豆!","color":"white"}]
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@a[tag=hpm_holding]","color":"yellow","bold":false},{"text":" 获得了土豆!","color":"white","bold":false}]
 
 #初始土豆计分(土豆爆炸时间)
-scoreboard players set $hotpm_timer mem 30
+scoreboard players set $countdown mem 30

+ 1 - 1
data/mini/functions/hotpm/potato_transfer.mcfunction

@@ -1,4 +1,4 @@
 # 传土豆+提示
 function mini:hotpm/pm_lost
 execute as @a[tag=pm_damage_taken] run function mini:hotpm/pm_get
-tellraw @a [{"text":">> ","color":"gold"},{"selector":"@s","color":"yellow"},{"text":" 将土豆拍在了 ","color":"white"},{"selector":"@a[tag=pm_damage_taken]","color":"yellow"},{"text":" 的脸上!","color":"white"}]
+tellraw @a [{"text":">> ","color":"gold","bold":true},{"selector":"@s","color":"yellow","bold":false},{"text":" 将土豆拍在了 ","color":"white","bold":false},{"selector":"@a[tag=pm_damage_taken]","color":"yellow","bold":false},{"text":" 的脸上!","color":"white","bold":false}]

+ 3 - 3
data/mini/functions/hotpm/tick20.mcfunction

@@ -1,5 +1,5 @@
 #土豆倒计时
-execute if score $hotpm_timer mem matches 1.. run scoreboard players remove $hotpm_timer mem 1
-execute if score $hotpm_timer mem matches 1.. run title @a actionbar [{"text":"土豆爆炸: ","color":"red"},{"score": { "name": "$hotpm_timer","objective": "mem"},"color":"gold"}]
+execute if score $countdown mem matches 1.. run scoreboard players remove $countdown mem 1
+execute if score $countdown mem matches 1.. run title @a actionbar [{"text":"土豆爆炸: ","color":"red"},{"score": { "name": "$countdown","objective": "mem"},"color":"gold"}]
 #爆炸
-execute if score $hotpm_timer mem matches 0 as @a[tag=hpm_holding] run function mini:hotpm/pm_boom
+execute if score $countdown mem matches 0 as @a[tag=hpm_holding] run function mini:hotpm/pm_boom