How can I make a potion effect that damages armor??

Started by ASEStefan on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make a potion effect that damages armor??

I want to have an effect named corrosion in my case that when applied ( on update tick probably ) damages armor by time to time, how do I do that?

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make the status effect, and…
Thu, 06/22/2023 - 19:31

Make the status effect, and set up a procedure for effect tick.

Use the default procedure template "strike lightning every 10th time procedure is called (for entities)." Remove the strike lightning block, but keep the rest.

Then, use the "damage item" blocks and the "get item in armor slot [x] of event/target entity." Choose an appropriate damage amount. You need to do it four times for every slot.

If that causes crashes or weirdness when using skulls or pumpkins (non-damageable armor), use if blocks to make sure there actually is a damageable item in each armor slot before damaging it.

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Uh yeah that wasn't working…
Fri, 07/07/2023 - 08:17

Uh yeah that wasn't working but I have found a fix myself. U just repeat the get armor procedure for helmet chestplate leggings and boots, tested it myself and it works