fabric icon indicating copy to clipboard operation
fabric copied to clipboard

Add render entity callback

Open michiel1106 opened this issue 6 months ago • 2 comments

An event that is called before the entity gets rendered, containing the entity that is to be rendered. It would be useful for if you want to do anything with checking if an entity is actually being rendered, doing something with a specific entity only if its being rendered etc.

michiel1106 avatar Jun 27 '25 15:06 michiel1106

I think this would be solved by the hypothetical renderstate API that kind of fuzzeled

cputnam-a11y avatar Jun 27 '25 15:06 cputnam-a11y

We'll see what ~~other~~(I suppose I'm not a maintainer lol) the maintainers say, but this also seems like an event that falls into the same category as entity tick

cputnam-a11y avatar Jun 27 '25 15:06 cputnam-a11y

Yeah, I dont think this is really what we want for entities, we should aim to follow what vanilla does with the render states. Accessing the the actual Entity instance when rendering isnt correct and will explode when mojang split the state building and rendering onto two threads. Finding a good solution to this in FAPI is possible but needs some careful work.

For now Mixin is a great tool for being able to expand vanilla's render states as you can easily add new fields with little overhead.

Thanks for the PR, I'd be happy to discuss a better long term solution for FAPI or a short term solution for your mod.

modmuss50 avatar Jun 30 '25 18:06 modmuss50