Posted September 3, 20178 yr While modding I learned how to register Items and I could not figure out how to register blocks. I try the same method as I did with my items but when I try to /give myself the block, it states it does not exist while the items do. Code for registering Items: @SubscribeEvent public void registerItems(RegistryEvent.Register<Item>event) { final IForgeRegistry<Item> registry = event.getRegistry(); registry.register(digging_hoe); registry.register(hells_scream); } OR @SubscribeEvent public void registerItems(RegistryEvent.Register<Item>event) { event.getRegistry().registerAll(digging_hoe, hells_scream); } Code for registering Blocks: @SubscribeEvent public void registerBlocks(final RegistryEvent.Register<Block>event) { final IForgeRegistry<Block> registry = event.getRegistry(); registry.register(adobe); } OR @SubscribeEvent public void registerBlocks(final RegistryEvent.Register<Block>event) { event.getRegistry().registerAll(adobe); } Any help in registering blocks would be great! I tried to look for a response on other threads but they did not make sense to me. I would also be grateful on an explanation on why another method could be used. Thanks!
September 3, 20178 yr What does the whole class look like? Are you using the @ObjectHolder and @Mod.EventBusSubscriber annotations properly on your block registration class? Check out my tutorials here: http://jabelarminecraft.blogspot.com/
September 4, 20178 yr Author 2 hours ago, jabelar said: What does the whole class look like? Are you using the @ObjectHolder and @Mod.EventBusSubscriber annotations properly on your block registration class? Actually the link to your tutorials, http://jabelarminecraft.blogspot.com/, really helped a lot and I got it figured out. Thank you
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.