Jump to content

Rendering an item in 3D when held, but as a 2D icon in GUI [Solved]


Korall

Recommended Posts

(I'm working in 1.16.5)

 

Hello. So what I am trying to do is render an item in 3D when held, but as a regular 2D item when looking at it in the GUI (Like the trident). I have so far been unable to find anything about it really. Looking at the json models of the trident shows that there are two seperate models for it, one for 2d and one for 3d (And another rotated 3d one for when its raised in the air when aiming with it). Looking into the trident item code (or the trident entity renderer) also didn't really yield anything, so I'm assuming something more complex is at play; some kind of custom renderer that is hardcoded for the trident? From what I've been able to find it seems like I should use ItemStackTileEntityRenderer though I'm not sure if I'm on the right path or not with that one, and the documentation on it isn't exactly comprehensive. And I'm not familair at all with renderers and whatnot.

 

I am aware that there are some "tricks" one could use to achive something similair with just a standard JSON model, but it doesn't seem like an optimal solution.

Edited by Korall
Solved
Link to comment
Share on other sites

19 hours ago, poopoodice said:

 


"loader": "forge:separate-perspective"

where you can use different models when handling different perspectives: 


SeparatePerspectiveModel

I'm suprised at how simple this was. Though it was a bit tricky in some ways, mostly since I don't know much about how the JSON models work. But it seems to make the generated item icons very dark; I figure its some kind of lighting thing. image.png.9ff95e05644fc54a89d92816ae3cbeb8.pngSo I'm guessing I cant straight up use the standard item/generated for the replacement model.

 

EDIT: From my experimentation, it is definitely a lighting issue. It shades the item model in the same way it shades the block and 3d item models, which makes it appear dark, since the face is rotated 45 degrees from the light direction. And overriding elements' "shade" property or the "gui_light" property also dosen't seem to have any effect on the shading.

 

EDIT again: Nevermind, overriding "gui_light":"front" does work, but you need to do it outside of the actual base model or perspective definitions

Edited by Korall
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.