Posted March 12, 20205 yr Hello, I'm making a mod with a custom entity at the moment but for some reason the event isn't called. Can someone tell me what I maybe did wrong? This is my main class: public AxolotlMod() { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void registerEntitySpawnEggs(RegistryEvent.Register<Item> event) { event.getRegistry().register(AxolotlRegistry.AXOLOTL_ENTITY_EGG = AxolotlRegistry .registerEntitySpawnEgg(AxolotlRegistry.AXOLOTL_ENTITY, 0xf0f0f0, 0xdf51f5, "axolotl_entity_egg")); } @SubscribeEvent public void registerEntityType(RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().register(AxolotlRegistry.AXOLOTL_ENTITY); AxolotlRegistry.register(); RenderingRegistry.registerEntityRenderingHandler(AxolotlRegistry.AXOLOTL_ENTITY, new AxolotlRender.RenderFactory()); }
March 12, 20205 yr Post a github repository of the code, it would be much simpler to identify the problem
March 12, 20205 yr you are using the wrong bus https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/mdk/src/main/java/com/example/examplemod/ExampleMod.java#L30
March 12, 20205 yr Hi See also this guide for hints about which-bus-for-which-event. http://greyminecraftcoder.blogspot.com/2020/02/how-forge-starts-up-your-code-1144.html With a worked example here: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/MinecraftByExample.java -TGG
March 12, 20205 yr Author 14 minutes ago, TheGreyGhost said: Hi See also this guide for hints about which-bus-for-which-event. http://greyminecraftcoder.blogspot.com/2020/02/how-forge-starts-up-your-code-1144.html With a worked example here: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/MinecraftByExample.java -TGG 25 minutes ago, loordgek said: you are using the wrong bus https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/mdk/src/main/java/com/example/examplemod/ExampleMod.java#L30 Thank you guys
March 12, 20205 yr 55 minutes ago, RobinCirex said: AxolotlRegistry.AXOLOTL_ENTITY_EGG = By the way, don't do this. Use @ObjectHolder annotations. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.