Class RenderLivingEvent<T extends LivingEntity,M extends EntityModel<T>>
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RenderLivingEvent<T,M>
- Type Parameters:
T
- the living entity that is being renderedM
- the model for the living entity
- Direct Known Subclasses:
RenderLivingEvent.Post
,RenderLivingEvent.Pre
public abstract class RenderLivingEvent<T extends LivingEntity,M extends EntityModel<T>>
extends net.neoforged.bus.api.Event
Fired when a
LivingEntity
is rendered.
See the two subclasses to listen for before and after rendering.
Despite this event's use of generic type parameters, this is not a
,
and should not be treated as such (such as using generic-specific listeners, which may cause a invalid reference
net.neoforged.bus.api.GenericEvent
ClassCastException
).
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
RenderLivingEvent.Post<T extends LivingEntity,
M extends EntityModel<T>> Fired after an entity is rendered, if the correspondingRenderLivingEvent.Post
is not cancelled.static class
RenderLivingEvent.Pre<T extends LivingEntity,
M extends EntityModel<T>> Fired before an entity is rendered. -
Field Summary
Modifier and TypeFieldDescriptionprivate final LivingEntity
private final MultiBufferSource
private final int
private final float
private final PoseStack
private final LivingEntityRenderer
<T, M> -
Constructor Summary
ModifierConstructorDescriptionprotected
RenderLivingEvent
(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) -
Method Summary
Modifier and TypeMethodDescriptionReturns the source of rendering buffers.int
Returns the amount of packed (sky and block) light for rendering.float
Returns the partial tick.Returns the pose stack used for rendering.
-
Field Details
-
entity
-
renderer
-
partialTick
private final float partialTick -
poseStack
-
multiBufferSource
-
packedLight
private final int packedLight
-
-
Constructor Details
-
RenderLivingEvent
@Internal protected RenderLivingEvent(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight)
-
-
Method Details
-
getEntity
- Returns:
- the living entity being rendered
-
getRenderer
- Returns:
- the renderer for the living entity
-
getPartialTick
public float getPartialTick()Returns the partial tick.- Returns:
- the partial tick
-
getPoseStack
Returns the pose stack used for rendering.- Returns:
- the pose stack used for rendering
-
getMultiBufferSource
Returns the source of rendering buffers.- Returns:
- the source of rendering buffers
-
getPackedLight
public int getPackedLight()Returns the amount of packed (sky and block) light for rendering.- Returns:
- the amount of packed (sky and block) light for rendering
- See Also:
-