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.GenericEventClassCastException).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRenderLivingEvent.Post<T extends LivingEntity,M extends EntityModel<T>> Fired after an entity is rendered, if the correspondingRenderLivingEvent.Postis not cancelled.static classRenderLivingEvent.Pre<T extends LivingEntity,M extends EntityModel<T>> Fired before an entity is rendered. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LivingEntityprivate final MultiBufferSourceprivate final intprivate final floatprivate final PoseStackprivate final LivingEntityRenderer<T, M> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRenderLivingEvent(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) -
Method Summary
Modifier and TypeMethodDescriptionReturns the source of rendering buffers.intReturns the amount of packed (sky and block) light for rendering.floatReturns 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:
-