Interface PlayerHeadObjectContents.Builder
- Enclosing interface:
PlayerHeadObjectContents
public static sealed interface PlayerHeadObjectContents.Builder
A builder for a
PlayerHeadObjectContents.- Since:
- 4.25.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the player head contents.hat(boolean hat) Sets whether the player head should render the player's hat layer.Sets the UUID of the player.Sets the name of the player.profileProperties(Collection<? extends PlayerHeadObjectContents.ProfileProperty> properties) Sets multiple profile properties.Sets a profile property.skin(PlayerHeadObjectContents.SkinSource skinSource) Sets the skin (name, id, properties, and texture) from the given source, overriding any existing values.Sets the optional namespaced ID of the skin texture to use for rendering.
-
Method Details
-
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
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") PlayerHeadObjectContents.Builder profileProperty(PlayerHeadObjectContents.ProfileProperty property) Sets a profile property.- Parameters:
property- the property- Returns:
- this builder
- Since:
- 4.25.0
-
profileProperties
@Contract("_ -> this") PlayerHeadObjectContents.Builder profileProperties(Collection<? extends PlayerHeadObjectContents.ProfileProperty> properties) Sets multiple profile properties.- Parameters:
properties- the properties- Returns:
- this builder
- Since:
- 4.25.0
-
skin
@Contract("_ -> this") PlayerHeadObjectContents.Builder skin(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
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
-