Started by
DarkParty
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make an item that will trigger an effect (and save me) when I would take lethal damage, so how would I get that trigger to work?
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make an item that will trigger an effect (and save me) when I would take lethal damage, so how would I get that trigger to work?
I think something along the lines of.
Global trigger Entity is Attacked
If number dependency amount >= current health of event/target entity + absorption health of event/target entity AND whatever condition you want for the totem, such as item in main hand or item in off hand = totem.
Cancel event that triggered global trigger
Apply what other effects you want, such as probably shrinking the item in the player's main or off hand
That should work okay at least, although it won't account for armor. You could also try global trigger entity dies instead, and don't check for the amount of damage, but I tried that a while ago (in an older MCreator and MC version) and it only partially worked (my character died, but the respawn button would bring them back where they were, instead of at spawn point), so it may not work fully, I'm not sure.
k thx.