Module net.kyori.adventure.api
Package net.kyori.adventure.text.object
Interface PlayerHeadObjectContents
- All Superinterfaces:
ObjectContents
A player head contents.
This object closely mirrors the serialized form of the component contents. This means the game will use it's standard heuristics to determine whether the profile needs resolving before display. As of 1.21.9, the profile will be resolved if the name or id is present without any properties.
- Since:
- 4.25.0
- Since Minecraft:
- 1.21.9
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for aPlayerHeadObjectContents.static interfaceA player profile property value with an optional signature.static interfaceA source of player skin data. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default value for whether the player's hat layer should render. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhat()Whether the player head should render the player's hat layer.@Nullable UUIDid()Gets the UUID of the player if present.@Nullable Stringname()Gets the name of the player if present.@Unmodifiable List<PlayerHeadObjectContents.ProfileProperty> Gets the profile properties for the player.Creates a profile property with the given value and no signature.Creates a profile property with the given value and signature.@Nullable Keytexture()Optional namespaced ID of the skin texture to use for rendering.Creates a builder from the state of this object.
-
Field Details
-
DEFAULT_HAT
static final boolean DEFAULT_HATThe default value for whether the player's hat layer should render.- Since:
- 4.25.0
- See Also:
-
-
Method Details
-
name
@Nullable String name()Gets the name of the player if present.- Returns:
- the name of the player or null
- Since:
- 4.25.0
-
id
@Nullable UUID id()Gets the UUID of the player if present.- Returns:
- the UUID of the player or null
- Since:
- 4.25.0
-
profileProperties
@Unmodifiable List<PlayerHeadObjectContents.ProfileProperty> profileProperties()Gets the profile properties for the player.- Returns:
- the properties
- Since:
- 4.25.0
-
hat
boolean hat()Whether the player head should render the player's hat layer.- Returns:
- whether to render the hat layer
- Since:
- 4.25.0
-
texture
@Nullable Key texture()Optional namespaced ID of the skin texture to use for rendering.The skin is specified relative to the textures folder and with a .png suffix e.g. entity/player/wide/steve will use the default wide Steve skin.
Overrides the skin specified by the profile properties if present.
- Returns:
- the texture key
- Since:
- 4.25.0
-
toBuilder
Creates a builder from the state of this object.- Returns:
- a new builder
- Since:
- 4.25.0
-
property
@Contract(value="_, _ -> new", pure=true) static PlayerHeadObjectContents.ProfileProperty property(String name, String value) Creates a profile property with the given value and no signature.- Parameters:
name- the namevalue- the value- Returns:
- a profile property
- Since:
- 4.25.0
-
property
@Contract(value="_, _, _ -> new", pure=true) static PlayerHeadObjectContents.ProfileProperty property(String name, String value, @Nullable String signature) Creates a profile property with the given value and signature.- Parameters:
name- the namevalue- the valuesignature- the signature, may be null- Returns:
- a profile property
- Since:
- 4.25.0
-