Package net.minecraftforge.client.event
Class RenderNameplateEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.client.event.RenderNameplateEvent
RenderNameplateEvent is fired whenever the entity renderer attempts to render a name plate/tag of an entity.
This event has a result.
ALLOW will force-render name plate/tag, DEFAULT will ignore the hook and continue using the vanilla check and DENY will prevent name plate/tag from rendering
This event is fired on the
nameplateContent
contains the content being rendered on the name plate/tag. This can be changed by mods.originalContent
contains the original content being rendered on the name plate/tag. This cannot be
changed by mods.entityRenderer
contains the entity renderer instance that renders the name plate/tag. This cannot be
changed by mods.poseStack
contains the matrix stack instance involved in rendering the name plate/tag. This cannot
be changed by mods.multiBufferSource
contains the render type buffer instance involved in rendering the name plate/tag.
This cannot be changed by mods.packedLight
contains the sky and block light values used in rendering the name plate/tag.partialTick
contains the partial ticks used in rendering the name plate/tag. This cannot be changed by mods.This event has a result.
Event.HasResult
. ALLOW will force-render name plate/tag, DEFAULT will ignore the hook and continue using the vanilla check and DENY will prevent name plate/tag from rendering
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EntityRenderer<?>
private final MultiBufferSource
private Component
private final Component
private final int
private final float
private final PoseStack
-
Constructor Summary
ConstructorDescriptionRenderNameplateEvent
(Entity entity, Component content, EntityRenderer<?> entityRenderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, float partialTick) -
Method Summary
Modifier and TypeMethodDescriptionThe content being rendered on the name plate/tagThe entity renderer that renders the name plate/tag, if it was providedThe render type buffer used during the rendering of the name plate/tagThe original content being rendered on the name plate/tagint
The packed values of sky and block light used during the rendering of the name plate/tagfloat
The partial ticks used during the rendering of the name plate/tagThe matrix stack used during the rendering of the name plate/tagvoid
setContent
(Component contents) Sets the content that is to be rendered on the name plate/tagMethods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
nameplateContent
-
originalContent
-
entityRenderer
-
poseStack
-
multiBufferSource
-
packedLight
private final int packedLight -
partialTick
private final float partialTick
-
-
Constructor Details
-
RenderNameplateEvent
public RenderNameplateEvent(Entity entity, Component content, EntityRenderer<?> entityRenderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, float partialTick)
-
-
Method Details
-
setContent
Sets the content that is to be rendered on the name plate/tag -
getContent
The content being rendered on the name plate/tag -
getOriginalContent
The original content being rendered on the name plate/tag -
getEntityRenderer
The entity renderer that renders the name plate/tag, if it was provided -
getPoseStack
The matrix stack used during the rendering of the name plate/tag -
getMultiBufferSource
The render type buffer used during the rendering of the name plate/tag -
getPackedLight
public int getPackedLight()The packed values of sky and block light used during the rendering of the name plate/tag -
getPartialTick
public float getPartialTick()The partial ticks used during the rendering of the name plate/tag
-