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

Hi guys! I want to add some tooltips to my new blocks. I already did this on the Items with this method:

 

 

        @Override
        public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4)
        {
                list.add("Some Information");
        }

 

 

 

The same method doesn't work for the blocks, of course. I searched the Block.java for similar methods, but I ended up with nothing. I know that adding tooltips to blocks IS possible, see Factorization. Now, how can I do this?

 

Thanks in advance

~bl4ckscor3

↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑

Hey!

 

I had a similar issue a few weeks ago, but discovered that if you register your block as if it had metadata, then in your ItemBlock.java you can add the item lore.

 

To register your block:

GameRegistry.registerBlock(BlockCustom, ItemBlockCustom.class, "YourMod.BlockCustom";

 

In your ItemBlockCustom.java file:

@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4)
{
      list.add("Some Information");
}

 


 

I wrote this code from memory, so it may not be correct. It should point you on the right track though :P

 

Hope this helped!

Luis :D

  • Author

Hey!

 

I had a similar issue a few weeks ago, but discovered that if you register your block as if it had metadata, then in your ItemBlock.java you can add the item lore.

 

To register your block:

GameRegistry.registerBlock(BlockCustom, ItemBlockCustom.class, "YourMod.BlockCustom";

 

In your ItemBlockCustom.java file:

@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4)
{
      list.add("Some Information");
}

 


 

I wrote this code from memory, so it may not be correct. It should point you on the right track though :P

 

Hope this helped!

Luis :D

Thanks, that was exactly right! (I don't really feel like making new classes only for Information but oh, well....) :)

↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑

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.