Package net.kyori.adventure.text.object
Interface PlayerHeadObjectContents
- All Superinterfaces:
net.kyori.examination.Examinable,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 TypeMethodDescriptiondefault @NotNull Stream<? extends net.kyori.examination.ExaminableProperty>booleanhat()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 @NotNull 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.@NotNull PlayerHeadObjectContents.BuilderCreates a builder from the state of this object.Methods inherited from interface net.kyori.examination.Examinable
examinableName, examine
-
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
Gets the name of the player if present.- Returns:
- the name of the player or null
- Since:
- 4.25.0
-
id
Gets the UUID of the player if present.- Returns:
- the UUID of the player or null
- Since:
- 4.25.0
-
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
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(@NotNull @NotNull String name, @NotNull @NotNull 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(@NotNull @NotNull String name, @NotNull @NotNull String value, @Nullable @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
-
examinableProperties
@NotNull default @NotNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()- Specified by:
examinablePropertiesin interfacenet.kyori.examination.Examinable
-