Posted September 3, 20214 yr Hi! I want to understand how this works. Reading Forge Documentation I made this at first: @Mod.EventBusSubscriber(modid = RedOptionsMod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class StaticClientOnlyEventHandler { @SubscribeEvent public static void spriteAdd(TextureStitchEvent.Pre event) { if (!event.getMap().location().equals(InventoryMenu.BLOCK_ATLAS)) return; event.addSprite(Resources.FILTER); } } But this event is never fired (I don't think it should have been registered..)So, I removed the line: @Mod.EventBusSubscriber, and I did this at my mod class: if (FMLLoader.getDist().isClient()) FMLJavaModLoadingContext.get().getModEventBus().register(StaticClientOnlyEventHandler.class); And it is working (working and don't crashing at server side). Tow questions: 1. Why the first method didn't work, am I missing something? 2. Is the second way the correct way to register specific side events, using (FMLLoader.getDist().isClient()) ? Thank you! Edited September 3, 20214 yr by GnRSlashSP †GnR† Slash can one man truly make a difference?
September 5, 20214 yr Author Oh, Now I understand. public class TextureStitchEvent extends Event implements IModBusEvent -> this means it is MOD bus Thank you! †GnR† Slash can one man truly make a difference?
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.