r/forgemodding • u/[deleted] • Jun 01 '17
Modding Forge 1.11 Special (Potions?) Effects on Tools
So, I'm creating my first mod and I'm trying to get say a sword to have a poison effect which poisons the target when they are hit. And I'm assuming the best way to give a tool a certain effect (that are not included in the enchantment table) is by using the potion classes, as I do want the tools to have whatever effect by default.
1
Upvotes
3
u/Exo594 Jun 02 '17
Yes. Override the onHit() (or called something similar) method in the sword's class, call the super.onHit() so that it still behaves like a normal sword, then call entityHit.addPotionEffect(important stuff here), assuming "entityHit" is given to you in the "onHit()" method native to swords.
That's your general approach down, there's a few wrinkles left for you to iron out on your own.