#Detecting when a player takes damage - predicates?

1 messages · Page 1 of 1 (latest)

tawdry whale
#

I want to teleport a player with the /spreadplayers command whenever they take damage. I don't think this can be achieved with the health scoreboard since I only want it to be when they take damage, not when they're below max health. I tried looking this up but I couldn't really find anything. Any help on how to achieve this would be greatly appreciated!

glossy elbowBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1745520531:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

deep dagger
#

Use the advancement entity_hurt_player. It triggers when the player takes any damage, not just from entities

tawdry whale
#

Okay, thanks! Really sorry but could you tell me how? I've never really used it before. Should I make a new "advancements" folder for this?

#

(Or if you know a wiki or page to help either)

deep dagger
#

advancements

#

no s

tawdry whale
#

Okay gotcha, thanks

deep dagger
#

the code for it is very simple

#

it only needs the mention trigger and a function that it can run as reward, no extra checks or conditions.

tawdry whale
#

Ohh okay that makes sense

#

Thank you so much