#render client side entities within gui

17 messages · Page 1 of 1 (latest)

low tree
#

Im working on a client side mod which needs to render entnties inside of a gui (this includes mainly players with specific armor on, and items) i am currently looking at DrawContext.addEntity but cant figure it out or how to get an EntityRenderState, can anyone help me out?

slate inlet
#

There's a method in I think the players inventory that can render a player that you can just call

#

Unsure if it can render other entities

pale aspen
#

it can cuz it’s used for horses and stuff too

#

iirc it’s InventoryScreen.renderEntityInScreen (mojmaps) or something along those lines

#

do note you’ll probably need fabric api if you plan on rendering multiple in a single frame

low tree
#

alright i got rendering players working but how do i get a client side ItemEntity that i can then render

low tree
#

i do want to also ask how to render just normal items but at a custom size

pale aspen
# low tree could you elaborate?

basically for most picture in picture renderers (like the entity in gui one), the game will only use the last submitted state for all of them in the same frame, so they all render the last entity
fabric api fixes that, can’t remember what module specifically but probably one of the rendering ones

low tree
pale aspen
#

u dont need to do anything special for it to work btw, just as long as its installed pip renderers will work as you expect

low tree
#

pip renderer?

pale aspen
#

picture in picture

low tree
#

ah so just like screens?

pale aspen
#

when you see an entity or other 3d element in a gui its a picture in picture renderer, i think yarn calls them special ui element or something but yea

low tree
#

ah ok gotcha