How do I make it so that armor takes damage when a potion is active?

Started by markjaveyt on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make it so that armor takes damage when a potion is active?

I'm working on a mod right now, and I've had problems with creating a potion that damages the player's armor when the effect is applied.

I don't know if I'm missing some logical stuff but I tried doing if and get item from armor slot which ended up in failure.

Are there any ways to achieve this?
Thanks!

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(If you haven't already)…
Thu, 07/10/2025 - 12:22

(If you haven't already) create an "On active potion ticks" procedure.

Armor slots are: 

Slot 0 Boots

Slot 1 Leggins

Slot 2 Chestplate

Slot 3 Helmet

Now, add the procedure block "Deal <yourDamageAmount> of damage to <get item from armorSlot <0, 1, 2, 3>". I recommend you create an NBT cooldown so as not to damage your armor every tick.