Package net.kyori.adventure.text.object
Interface PlayerHeadObjectContents.Builder
- Enclosing interface:
- PlayerHeadObjectContents
public static interface PlayerHeadObjectContents.Builder
A builder for a
PlayerHeadObjectContents
.- Since:
- 4.25.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull PlayerHeadObjectContents
build()
Builds the player head contents.@NotNull PlayerHeadObjectContents.Builder
hat
(boolean hat) Sets whether the player head should render the player's hat layer.@NotNull PlayerHeadObjectContents.Builder
Sets the UUID of the player.@NotNull PlayerHeadObjectContents.Builder
Sets the name of the player.@NotNull PlayerHeadObjectContents.Builder
profileProperties
(@NotNull Collection<PlayerHeadObjectContents.ProfileProperty> properties) Sets multiple profile properties.@NotNull PlayerHeadObjectContents.Builder
profileProperty
(@NotNull PlayerHeadObjectContents.ProfileProperty property) Sets a profile property.@NotNull PlayerHeadObjectContents.Builder
skin
(@NotNull PlayerHeadObjectContents.SkinSource skinSource) Sets the skin (name, id, properties, and texture) from the given source, overriding any existing values.@NotNull PlayerHeadObjectContents.Builder
Sets the optional namespaced ID of the skin texture to use for rendering.
-
Method Details
-
name
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder name(@Nullable @Nullable String name) Sets the name of the player.- Parameters:
name
- the name of the player, may be null- Returns:
- this builder
- Since:
- 4.25.0
-
id
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder id(@Nullable @Nullable UUID id) Sets the UUID of the player.- Parameters:
id
- the UUID of the player, may be null- Returns:
- this builder
- Since:
- 4.25.0
-
profileProperty
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder profileProperty(@NotNull @NotNull PlayerHeadObjectContents.ProfileProperty property) Sets a profile property.- Parameters:
property
- the property- Returns:
- this builder
- Since:
- 4.25.0
-
profileProperties
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder profileProperties(@NotNull @NotNull Collection<PlayerHeadObjectContents.ProfileProperty> properties) Sets multiple profile properties.- Parameters:
properties
- the properties- Returns:
- this builder
- Since:
- 4.25.0
-
skin
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder skin(@NotNull @NotNull PlayerHeadObjectContents.SkinSource skinSource) Sets the skin (name, id, properties, and texture) from the given source, overriding any existing values.- Parameters:
skinSource
- the skin source- Returns:
- this builder
- Since:
- 4.25.0
-
hat
Sets whether the player head should render the player's hat layer.Default is
true
.- Parameters:
hat
- whether to render the hat layer- Returns:
- this builder
- Since:
- 4.25.0
-
texture
@Contract("_ -> this") @NotNull @NotNull PlayerHeadObjectContents.Builder texture(@Nullable @Nullable Key texture) Sets the 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.
- Parameters:
texture
- the texture key or null- Returns:
- this builder
- Since:
- 4.25.0
-
build
Builds the player head contents.- Returns:
- a new player head contents
- Since:
- 4.25.0
-