Jump to content

[1.11] Rendering item from a particular slot.


Viesis

Recommended Posts

I currently have a custom crafting table that stores items in it.  What I would like to do is render an item (either in 2d or 3d from a block) from a particular item slot in a tile entity and have it appear on top of my crafting table. 

 

I am honestly not sure where to start.  I think I would have to get the item from the slot and in the renderer for my tile entity, have the item in said slot "rendered" as well, but really not sure how to do it.  I tried to look at RenderItemFrame, but so far haven't seen what I really need to focus on to get it working. Any suggestion on where to look or what to read would be appreciated.  Thanks!

 

Link to comment
Share on other sites

I currently have a custom crafting table that stores items in it.  What I would like to do is render an item (either in 2d or 3d from a block) from a particular item slot in a tile entity and have it appear on top of my crafting table. 

 

I am honestly not sure where to start.  I think I would have to get the item from the slot and in the renderer for my tile entity, have the item in said slot "rendered" as well, but really not sure how to do it.  I tried to look at RenderItemFrame, but so far haven't seen what I really need to focus on to get it working. Any suggestion on where to look or what to read would be appreciated.  Thanks!

I believe this is doable with a IBakedModel implementation and I don't think there is much documentation on them at the moment, though I may be wrong, and if I am I would very much like to be corrected. If you do not know how to make an IBakedModel implementation use a TESR at the moment. I suggest adding some boolean(s) to your TE that determine if the slots have changed, overall if the items need to be re rendered to the Screen.

 

Edit: To actually render the item in the TESR look at using an EntityItem and how it renders to the screen.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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.