类 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.
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private final EntityRenderer
<?, ?> private final MultiBufferSource
private Component
private final Component
private final int
private final PoseStack
private final EntityRenderState
-
构造器概要
构造器构造器说明RenderNameTagEvent
(EntityRenderState state, Component content, EntityRenderer<?, ?> entityRenderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) -
方法概要
修饰符和类型方法说明返回 the text on the nameplate that will be rendered, if the event is notDENIED
。EntityRenderer
<?, ?> 返回 the entity renderer rendering the nameplate。返回 the source of rendering buffers。返回 the original text on the nameplate。int
返回 the amount of packed (sky and block) light for rendering。返回 the pose stack used for rendering。<T extends EntityRenderState>
TgetState()
void
setContent
(Component contents) Sets the new text on the nameplate.从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
nameplateContent
-
state
-
originalContent
-
entityRenderer
-
poseStack
-
multiBufferSource
-
packedLight
private final int packedLight
-
-
构造器详细资料
-
RenderNameTagEvent
@Internal public RenderNameTagEvent(EntityRenderState state, Component content, EntityRenderer<?, ?> entityRenderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight)
-
-
方法详细资料
-
getState
-
setContent
Sets the new text on the nameplate.- 参数:
contents
- the new text
-
getContent
返回 the text on the nameplate that will be rendered, if the event is notDENIED
。- 返回:
- the text on the nameplate that will be rendered, if the event is not
DENIED
-
getOriginalContent
返回 the original text on the nameplate。- 返回:
- the original text on the nameplate
-
getEntityRenderer
返回 the entity renderer rendering the nameplate。- 返回:
- the entity renderer rendering the nameplate
-
getPoseStack
返回 the pose stack used for rendering。- 返回:
- the pose stack used for rendering
-
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
- 另请参阅:
-