@@ -2,7 +2,7 @@
tag @s add damage_dealt
# 播放攻击音效
-playsound minecraft:entity.arrow.hit_player ambient @s ~ ~ ~ 1 1 1
+# playsound minecraft:entity.arrow.hit_player ambient @s ~ ~ ~ 1 1 1
# 移除造成伤害advancement
advancement revoke @s only lib:damage_dealt
@@ -1,9 +1,11 @@
# 造成伤害加tag
-tag @s add pm_damage_dealt
+execute if score $state mem matches 5 if score mini_type mem matches 3 run tag @s add pm_damage_dealt
-say 我打人了
+execute if score $state mem matches 5 if score mini_type mem matches 3 run playsound minecraft:entity.arrow.hit_player ambient @s ~ ~ ~ 1 1 1
-advancement revoke @s only mini:hotpm/pm_damage_dealt
+advancement revoke @s only mini:pm_damage_dealt
+
+# 检测土豆
+execute if score $state mem matches 5 if score mini_type mem matches 3 run function mini:hotpm/damage_event
@@ -0,0 +1,6 @@
+# 检测造成伤害者是否有土豆,有就转移
+execute if entity @s[tag=hpm_holding] run function mini:hotpm/potato_transfer
+# 清理tag
+tag @a remove pm_damage_dealt
+tag @a remove pm_damage_taken
@@ -1,7 +1,5 @@
# 收到伤害加tag
-tag @s add pm_damage_taken
-
-say 我被打了!
+execute if score $state mem matches 5 if score mini_type mem matches 3 run tag @s add pm_damage_taken
-advancement revoke @s only mini:hotpm/pm_damage_taken
+advancement revoke @s only mini:pm_damage_taken
@@ -0,0 +1,3 @@
+tag @s remove hpm_holding
+tag @a[tag=pm_damage_taken] add hpm_holding
+tellraw @a [{"text":">>","color":"red"},{"selector":"@s"},{"text":"将土豆拍在了","color":"gold"},{"selector":"pm_damage_taken"},{"text":"的脸上!","color":"gold"}]