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

Hey forums,

 

I recently made a block in my mod that has some fancy rendering when you place it down. I was wondering how I would render the same effects when the player is holding the block in their hand. I looked through the Item and Block classes to see if there was a method for when you hold the item, I found nothing. I also have tried a tick handler recently, but I'm unsure about which type of tick handler to use.

 

Any help is appreciated.

I could be thinking about this incorrectly because i have never tried it, but I think it will work.

 

When you create a custom weapon 3D render/model you have to give it the case if it is 3rd person, 1st person, or inventory.  For each case, you can point it to your block render.  Might have to make some adjustments.

 

I 'think'

The other trick is you need to tell your block to drop as a custom entity instead of the normal itementity.  When it is picked up, it deposits a custom item intead of the normal one for a block.

 

It is also possible you might just be able to register the item renderer to your blockitem if you can get the name right.

Long time Bukkit & Forge Programmer

Happy to try and help

  • Author

Forgot about IItemRenderer, thanks guys! I'll try the code out later today. I assume I can register the IItemRenderer to the block somehow? Maybe through an ItemBlock? :P Not sure exactly.

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.