How to make a enchantment book add wither damage to a sword

Started by Blixstorm on

Topic category: Help with modding (Java Edition)

Last seen on 23:58, 18. Jun 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a enchantment book add wither damage to a sword

Im making a enchant called withering where if you put it on a sword and hit someone they get the wither effect, does anyone know how to do this?

Last seen on 01:48, 23. Aug 2021
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So first, create an…
Sun, 07/04/2021 - 05:55

So first, create an enchantment. next, make a procedure that has the global trigger "When entity is hurt". Next, put an if block saying If: Get enchantment level of {Item in main hand of:[Source Entity(an actual block in the minecraft elements section]} type [Enchantment(In your case, withering)] > 0

next, inside of it, put a block that gives the potion effect to the entity [Event/target entity].

If you want to do a different level of wither/different amount of time, do Get enchantment level of {item in main hand of [source entity] type [Withering] *(multiplication symbol) [The number you want per level of the enchantment]

 

Hope this helps!