Need Help With Enchant Application.

Started by smokrock on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need Help With Enchant Application.

I'm new at all this forum stuff, so I am here to ask how I can get my enchant to apply to all swords. I have basic code that says 

IF (Get level of enchantment PoisonedBlade of provided itemstack = 1)
    Do add potion poison with level 1 for 60 ticks to Event/Target entity.
ELSE
    (Get level of enchantment PoisonedBlade of provided itemstack = 2)
      Do add potion poison with level 1 for 120 ticks to Event/Target entity.

I also have my enchantment be supported to "Mainhand" and Items that can be enchanted with this enchantment are swords only.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't get it... Are you on…
Thu, 10/09/2025 - 18:39

I don't get it... Are you on "world trigger: on entity attacked" or whatever it's called? That will check for every single attack in the game. Then you check whether the weapon used by source entity had your poison enchant and then add poison effect to the target entity.