Interface PlayerHeadObjectContents

All Superinterfaces:
net.kyori.examination.Examinable, ObjectContents

@NonExtendable public interface PlayerHeadObjectContents extends 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
  • Field Details

    • DEFAULT_HAT

      static final boolean DEFAULT_HAT
      The default value for whether the player's hat layer should render.
      Since:
      4.25.0
      See Also:
  • Method Details

    • name

      @Nullable @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 @Nullable UUID id()
      Gets the UUID of the player if present.
      Returns:
      the UUID of the player or null
      Since:
      4.25.0
    • profileProperties

      @NotNull @Unmodifiable @NotNull 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 @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

      @Contract(value="-> new", pure=true) @NotNull @NotNull PlayerHeadObjectContents.Builder 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 name
      value - 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 name
      value - the value
      signature - 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:
      examinableProperties in interface net.kyori.examination.Examinable