Class PlayerEvent.TabListNameFormat

Enclosing class:
PlayerEvent

public static class PlayerEvent.TabListNameFormat extends PlayerEvent
TabListNameFormat is fired when a player's display name for the tablist is retrieved.
This event is fired whenever a player's display name for the tablist is retrieved in ServerPlayer.getTabListDisplayName() or ServerPlayer.refreshTabListName().

This event is fired via the EventHooks.getPlayerTabListDisplayName(Player).

getDisplayName() contains the display name of the player or null if the client should determine the display name itself.
This event is not ICancellableEvent.
This event does not have a result.
invalid reference
Event.HasResult

This event is fired on the NeoForge.EVENT_BUS.
  • Field Details

    • displayName

      @Nullable private @Nullable net.minecraft.network.chat.Component displayName
  • Constructor Details

    • TabListNameFormat

      public TabListNameFormat(net.minecraft.world.entity.player.Player player)
  • Method Details

    • getDisplayName

      @Nullable public @Nullable net.minecraft.network.chat.Component getDisplayName()
    • setDisplayName

      public void setDisplayName(@Nullable @Nullable net.minecraft.network.chat.Component displayName)