Posted January 23, 201411 yr Hello, So I've been working on a mod to add a new enchantment for digging tools that I want to make incompatible with Silk Touch. If I override the canApplyTogether method in my Enchantment class I can make it so a tool already enchanted with Silk Touch cannot have my enchantment applied to it but not vice-versa. Here is my Enchantment Class: package mm347.jake_enchants; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentDigging; import net.minecraft.enchantment.EnumEnchantmentType; public class EnchantmentSuperHeat extends EnchantmentDigging { protected EnchantmentSuperHeat(int par1, int par2) { super(par1, par2); this.setName("superHeat"); } public int getMinEnchantability(int par1) { return 1 + 10 *(par1 - 1); } public int getMaxEnchantability(int par1) { return super.getMinEnchantability(par1) + 50; } public int getMaxLevel() { return 1; } public boolean canApplyTogether(Enchantment enchantment) { return super.canApplyTogether(enchantment) && enchantment.effectId != Enchantment.silkTouch.effectId; } } TL;DR How do I ensure that my enchantment remains 100% incompatible with specific other enchantments?
January 24, 201411 yr Hi This thread is a bit similar to what you're trying to do. http://www.minecraftforge.net/forum/index.php/topic,14923.msg75964.html#msg75964 I think the proposed answer was to check the enchantments every tick and remove any which were incompatible. -TGG
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.