Posted October 7, 20196 yr Class: [EnchantmentList] @ObjectHolder(Main.modid) public class EnchantmentList { public static final Enchantment soul_eater = new SoulEater(); @Mod.EventBusSubscriber(modid = Main.modid) public static class RegistrationHandler { /** * On event. * * @param event the event */ @SubscribeEvent public static void onEvent(final RegistryEvent.Register<Enchantment> event) { // DEBUG System.out.println("Registering Enchantments"); final IForgeRegistry<Enchantment> registry = event.getRegistry(); registry.register(new SoulEater()); } } } Class: [Soul Eater] public class SoulEater extends Enchantment { public SoulEater() { super(Rarity.COMMON, EnchantmentType.WEAPON, new EquipmentSlotType[] {EquipmentSlotType.MAINHAND}); setRegistryName(new ResourceLocation(Main.modid + ":soul_eater")); } @Override public int getMinEnchantability(int enchantmentLevel) { return 20 * enchantmentLevel; } @Override public int getMaxEnchantability(int enchantmentLevel) { return this.getMinEnchantability(enchantmentLevel) + 10; } @Override public int getMaxLevel() { return 1; } //@Override //protected boolean canApplyTogether(Enchantment ench) { // return super.canApplyTogether(ench) && ench != Enchantments.BLAST_PROTECTION; //} } I watched a harry talks tutorial on making custom enchantments for 1.12.2 and I looked at Jabelar's Minecraft Forge Modding Tutorials. I cant seem to get the enchantment ingame. Am I doing something wrong?
October 7, 20196 yr Author 7 minutes ago, diesieben07 said: This instance is never registered. The registry event fires on the mod event bus, you are registering for Forge's main event bus here. Thanks for your help I managed to get it to work
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.