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
-
public class RenderNameplateEvent extends EntityEvent
RenderNameplateEvent is fired whenever the entity renderer attempts to render a name plate/tag of an entity.
nameplateContentcontains the content being rendered on the name plate/tag. This can be changed by mods.
originalContentcontains the original content being rendered on the name plate/tag. This cannot be changed by mods.
entityRenderercontains the entity renderer instance that renders the name plate/tag. This cannot be changed by mods.
matrixStackcontains the matrix stack instance involved in rendering the name plate/tag. This cannot be changed by mods.
renderTypeBuffercontains the render type buffer instance involved in rendering the name plate/tag. This cannot be changed by mods.
packedLightcontains the sky and block light values used in rendering the name plate/tag.
partialTickscontains 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 & DENY will prevent name plate/tag from rendering
This event is fired on theMinecraftForge.EVENT_BUS.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private EntityRenderer<?>entityRendererprivate MatrixStackmatrixStackprivate ITextComponentnameplateContentprivate ITextComponentoriginalContentprivate intpackedLightprivate floatpartialTicksprivate IRenderTypeBufferrenderTypeBuffer
-
Constructor Summary
Constructors Constructor Description RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight, float partialTicks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITextComponentgetContent()The content being rendered on the name plate/tagEntityRenderer<?>getEntityRenderer()The entity renderer that renders the name plate/tag, if it was providedMatrixStackgetMatrixStack()The matrix stack used during the rendering of the name plate/tagITextComponentgetOriginalContent()The original content being rendered on the name plate/tagintgetPackedLight()The packed values of sky and block light used during the rendering of the name plate/tagfloatgetPartialTicks()The partial ticks used during the rendering of the name plate/tagIRenderTypeBuffergetRenderTypeBuffer()The render type buffer used during the rendering of the name plate/tagvoidsetContent(ITextComponent contents)Sets the content that is to be rendered on the name plate/tag-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
nameplateContent
private ITextComponent nameplateContent
-
originalContent
private final ITextComponent originalContent
-
entityRenderer
private final EntityRenderer<?> entityRenderer
-
matrixStack
private final MatrixStack matrixStack
-
renderTypeBuffer
private final IRenderTypeBuffer renderTypeBuffer
-
packedLight
private final int packedLight
-
partialTicks
private final float partialTicks
-
-
Constructor Detail
-
RenderNameplateEvent
public RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight, float partialTicks)
-
-
Method Detail
-
setContent
public void setContent(ITextComponent contents)
Sets the content that is to be rendered on the name plate/tag
-
getContent
public ITextComponent getContent()
The content being rendered on the name plate/tag
-
getOriginalContent
public ITextComponent getOriginalContent()
The original content being rendered on the name plate/tag
-
getEntityRenderer
public EntityRenderer<?> getEntityRenderer()
The entity renderer that renders the name plate/tag, if it was provided
-
getMatrixStack
public MatrixStack getMatrixStack()
The matrix stack used during the rendering of the name plate/tag
-
getRenderTypeBuffer
public IRenderTypeBuffer getRenderTypeBuffer()
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
-
getPartialTicks
public float getPartialTicks()
The partial ticks used during the rendering of the name plate/tag
-
-