类 RenderNameTagEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderNameTagEvent

public class RenderNameTagEvent extends net.minecraftforge.eventbus.api.Event
Fired before an entity renderer renders the nameplate of an entity.

This event is not cancellable, and has a result.

  • Event.Result.ALLOW - the nameplate will be forcibly rendered.
  • Event.Result.DEFAULT - the vanilla logic will be used.
  • Event.Result.DENY - the nameplate will not be rendered.

This event is fired on the main Forge event bus, only on the logical client.

另请参阅:
  • 字段详细资料

    • nameplateContent

      private Component nameplateContent
    • state

      private final EntityRenderState state
    • originalContent

      private final Component originalContent
    • entityRenderer

      private final EntityRenderer<?,?> entityRenderer
    • poseStack

      private final PoseStack poseStack
    • multiBufferSource

      private final MultiBufferSource multiBufferSource
    • packedLight

      private final int packedLight
  • 构造器详细资料

  • 方法详细资料

    • getState

      public <T extends EntityRenderState> T getState()
    • setContent

      public void setContent(Component contents)
      Sets the new text on the nameplate.
      参数:
      contents - the new text
    • getContent

      public Component getContent()
      返回 the text on the nameplate that will be rendered, if the event is not DENIED
      返回:
      the text on the nameplate that will be rendered, if the event is not DENIED
    • getOriginalContent

      public Component getOriginalContent()
      返回 the original text on the nameplate。
      返回:
      the original text on the nameplate
    • getEntityRenderer

      public EntityRenderer<?,?> getEntityRenderer()
      返回 the entity renderer rendering the nameplate。
      返回:
      the entity renderer rendering the nameplate
    • getPoseStack

      public PoseStack getPoseStack()
      返回 the pose stack used for rendering。
      返回:
      the pose stack used for rendering
    • getMultiBufferSource

      public MultiBufferSource getMultiBufferSource()
      返回 the source of rendering buffers。
      返回:
      the source of rendering buffers
    • getPackedLight

      public int getPackedLight()
      返回 the amount of packed (sky and block) light for rendering。
      返回:
      the amount of packed (sky and block) light for rendering
      另请参阅: