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.