Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.