Class PlayerEvent.NameFormat

Enclosing class:
PlayerEvent

public static class PlayerEvent.NameFormat extends PlayerEvent
NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved in Player.getDisplayName() or Player.refreshDisplayName().

This event is fired via the EventHooks.getPlayerDisplayName(Player, Component).

username contains the username of the player. displayname contains the display name of the player.
This event is not ICancellableEvent.
This event does not have a result. Event.HasResult
This event is fired on the NeoForge.EVENT_BUS.
  • Field Details

  • Constructor Details

  • Method Details

    • getUsername

      public Component getUsername()
    • getDisplayname

      public Component getDisplayname()
    • setDisplayname

      public void setDisplayname(Component displayname)