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!
I am trying to add an item to minecraft in my mod, this is my first time modding minecraft, and I was wondering if I could get some help on this error. In all honesty I have no clue what it means and I have no clue what files I would need to post to help someone try to figure it out. The error is:
If there are files that need to be shone, please tell me and I will attach them. Any help will be great! Thanks.
2 replies
Important Information
By using this site, you agree to our Terms of Use.