setCustomNametag

fun Entity.setCustomNametag(scoreboard: Scoreboard, sort: String, prefix: String? = null, suffix: String? = null)

Sets a custom nametag for an Entity instance, along with managing the scoreboard teams required to properly display the nametag information.

This method creates a team on the entity's scoreboard with the specified prefix, suffix, and sorting value. It also ensures visibility of other players' nametags by synchronizing all custom nametags across players on the server.

Parameters

sort

A string value representing the sort order for the custom nametag, used to organize teams.

prefix

An optional minimessage string to be displayed as the prefix of the entity's nametag. Defaults to null.

suffix

An optional minimessage string to be displayed as the suffix of the entity's nametag. Defaults to null.


fun SpigotPlayer.setCustomNametag(sort: String, prefix: String? = null, suffix: String? = null)

Sets a custom nametag for a SpigotPlayer instance, along with managing the scoreboard teams required to properly display the nametag information.

This method creates a team on the player's scoreboard with the specified prefix, suffix, and sorting value. It also ensures visibility of other players' nametags by synchronizing all custom nametags across players on the server.

Parameters

sort

A string value representing the sort order for the custom nametag, used to organize teams.

prefix

An optional minimessage string to be displayed as the prefix of the player's nametag. Defaults to null.

suffix

An optional minimessage string to be displayed as the suffix of the player's nametag. Defaults to null.