Started by
Spyjetray
on
Topic category: Troubleshooting, bugs, and solutions
So for my mod, I need the chest piece of armour to hurt the player when they put it on but only once when wearing it but it hurts them each time they equip it.
This is the code I have so far but it does not work.
I have tried a global world variable to turn on and off the part that deals damage but it does not work.
Can someone tell me where I have gone wrong?
Thanks.
Trigger this procedure using global player tick trigger. If you trigger this using armor tick event, your variable will not be reset once the player takes the armor down as once the armor is no on the player, this procedure won't be called anymore.
It worked perfectly, thanks!
You are welcome!
I have wanted to try this, but have a delay before it does damage (it's for a suggestion for a horror movie mod that includes Jigsaw, involving traps, in particular the reverse beartrap and flytrap traps). The aforementioned traps would be armor equipped in the head slot, and after a certain amount of time, they'd deal fatal damage (20 damage, or 10 hearts). They're meant to be part of a generated structure, where the player must possess a key and right-click it to remove the curse of binding enchantment from it (which serves as the "lock") to escape the trap.
Use a global timer system to add delay, or count the given status variable to a certain value to add N ticks delay, before you trigger your hurt action.