Posted January 22Jan 22 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);
January 22Jan 22 Quote /** * Helper to get the right instance from the {@link ModLoadingContext} correctly. * @return The FMLJavaMod language specific extension from the ModLoadingContext * * @deprecated use {@link FMLJavaModLoadingContext} in your mod constructor */ I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
January 23Jan 23 public ExampleMod(FMLJavaModLoadingContext context) { var modEventBus = context.getModEventBus(); } Refer to the javadocs and MDK for more pointers and examples. Official Forge Discord server | Support FAQ for players
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.