Repairing armor on weapon hit

Started by AvizvulGenesis on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Repairing armor on weapon hit
Sat, 04/02/2022 - 07:08 (edited)

I made an armor set and a weapon with the same material. And I want to make ability to repair armor on hit of the weapon. But everything I've been doing doesn't work

weapon procedure
Procedure with "When living entity is hit with tool" trigger
chestplate procedure
Body armor procedure. 20 damage is for testing. Doesn't work

 

Edited by AvizvulGenesis on Sat, 04/02/2022 - 07:08
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
On the first procedure, say …
Sat, 04/30/2022 - 05:31

On the first procedure, say :

Set NBT tag [armorVamp] true

wait [number (try with 1)] tick

Set NBT tag [armorVamp] false

 

On the second procedure, say :

If NBT tag [armorVamp] true for item in event/target entity hand

Set [item in slot 2] durability to [item in slot 2] durability + [number]