Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/) and post logs as described there for further help.
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
It says that '.get()' is deprecated since version 1.21.1 and has been marked for removal.
How should I replace this line or section of code so it works?
Or is there a way to fix it?
Full Block of Code:
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); // This is the line that's messed up... I don't know why
modEventBus.addListener(this::commonSetup);
MinecraftForge.EVENT_BUS.register(this);
Sorry to have bothered everyone. I think I've figured it out:
NbtUtils.snbtToStructure() will allow me to get the compound tag from a string I can load, and ItemStack.setTag() will allow me to write it to an item.
Again, sorry to bother everyone -- it took a long time to work it out, it seems finding answers on the internet by googling isn't a viable way to get info so it took a lot of guessing, experimenting, and trial and error until I hit upon the path to a solution.
Recommended Posts