Jump to content

[1.7.2] Rendering around player when holding block/item


Recommended Posts

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.

Posted

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

Posted

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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