How to make armour hurt player once when worn?

Started by Spyjetray on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 14:17, 4. Dec 2020
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make armour hurt player once when worn?

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.

https://imgur.com/a/QnxlM5d

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…
Wed, 07/03/2019 - 10:15

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.

Last seen on 14:17, 4. Dec 2020
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked perfectly, thanks!
Wed, 07/03/2019 - 13:10

It worked perfectly, thanks!

Last seen on 21:39, 21. Nov 2019
Joined Jun 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have wanted to try this,…
Wed, 11/06/2019 - 22:49

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…
Thu, 11/07/2019 - 09:48

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.