Hey, so I tried creating an enchantment but it literally doesn’t register in the game, even though I believe I did everything correct with the code but it still isn’t working. Also this block I created still doesn’t load the texture for it.
public class EnchantmentMod {
public static final DeferredRegister<Enchantment> ENCHANTMENTS =
DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, BaseMod.MODID);
public static RegistryObject<Enchantment> EXPLOSION =
ENCHANTMENTS.register("explosion",
() -> new Explosion(Enchantment.Rarity.UNCOMMON,
EnchantmentCategory.WEAPON, EquipmentSlot.MAINHAND));
public static void register(IEventBus eventBus) {
ENCHANTMENTS.register(eventBus);
}
public static void registerEnchantments(RegistryEvent.Register<Enchantment> event) {
}
}
Hey, so I tried creating an enchantment but it literally doesn’t register in the game, even though I believe I did everything correct with the code but it still isn’t working. Also this block I created still doesn’t load the texture for it.
here’s my EnchantmentMod File:
package com.idtech.enchantment;
import com.idtech.BaseMod;
import com.idtech.enchantment.Explosion;
import com.idtech.BaseMod;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class EnchantmentMod {
public static final DeferredRegister<Enchantment> ENCHANTMENTS =
DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, BaseMod.MODID);
public static RegistryObject<Enchantment> EXPLOSION =
ENCHANTMENTS.register("explosion",
() -> new Explosion(Enchantment.Rarity.UNCOMMON,
EnchantmentCategory.WEAPON, EquipmentSlot.MAINHAND));
public static void register(IEventBus eventBus) {
ENCHANTMENTS.register(eventBus);
}
public static void registerEnchantments(RegistryEvent.Register<Enchantment> event) {
}
}