public static class PlayerEvent.NameFormat extends PlayerEvent
PlayerEntity.getDisplayName()
for the first time or if PlayerEntity.refreshDisplayName()
is called.ForgeEventFactory.getPlayerDisplayName(PlayerEntity, String)
or ForgeEventFactory.getPlayerDisplayName(PlayerEntity, ITextComponent)
.username
contains the username of the player.
displayname
contains the display name of the player.
Cancelable
.
HasResult
MinecraftForge.EVENT_BUS
.PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.Visibility
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.EyeHeight
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
displayname |
private ITextComponent |
displaynameComponent |
private java.lang.String |
username |
private ITextComponent |
usernameComponent |
Constructor and Description |
---|
NameFormat(PlayerEntity player,
ITextComponent username) |
NameFormat(PlayerEntity player,
java.lang.String username)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDisplayname()
Deprecated.
|
ITextComponent |
getDisplaynameComponent() |
java.lang.String |
getUsername()
Deprecated.
|
ITextComponent |
getUsernameComponent() |
void |
setDisplayname(java.lang.String displayname)
Deprecated.
|
void |
setDisplaynameComponent(ITextComponent displayname) |
getPlayer
getEntityLiving
getEntity
private final java.lang.String username
private java.lang.String displayname
private final ITextComponent usernameComponent
private ITextComponent displaynameComponent
@Deprecated public NameFormat(PlayerEntity player, java.lang.String username)
NameFormat(PlayerEntity, ITextComponent)
public NameFormat(PlayerEntity player, ITextComponent username)
@Deprecated public java.lang.String getUsername()
getUsernameComponent()
@Deprecated public java.lang.String getDisplayname()
getDisplaynameComponent()
@Deprecated public void setDisplayname(java.lang.String displayname)
setDisplaynameComponent(ITextComponent)
public ITextComponent getUsernameComponent()
public ITextComponent getDisplaynameComponent()
public void setDisplaynameComponent(ITextComponent displayname)