Hey all. I finally got everything working and building with this tutorial (https://cadiboo.github.io/tutorials/1.14.4/forge/) however I can't get an item to appear. From what I can tell, I've followed the tutorial exactly save for a few things I modified to match someone else's code a bit who was asking the same question I was but his problem was that he was registering to the wrong eventbus.
Anyone have any thoughts?
Main.java:
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.fml.common.Mod;
@Mod(Main.MODID)
public final class Main {
public static final String MODID = "itemtest1";
public static final Logger LOGGER = LogManager.getLogger();
public Main() {
LOGGER.debug("TEST TEST");
}
}
ModEventSubscriber.java:
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.IForgeRegistryEntry;
@Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public final class ModEventSubscriber {
@SubscribeEvent
public static void onRegisterItems(RegistryEvent.Register<Item> event) {
event.getRegistry().registerAll(
setup(new Item(new Item.Properties()), "testitem")
);
}
public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) {
return setup(entry, new ResourceLocation(Main.MODID, name));
}
public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) {
entry.setRegistryName(registryName);
return entry;
}
}
From what I can tell, everything here should be accurate and correct. However, when I load into a newly created world and try to type /give Dev testitem I get an error that it's not found.