Interface SkullMeta

All Superinterfaces:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder

public interface SkullMeta extends ItemMeta
Represents a skull that can have an owner.
  • Method Details

    • getOwner

      @Deprecated(since="1.12.1") @Nullable String getOwner()
      Deprecated.
      Gets the owner of the skull.
      Returns:
      the owner if the skull
    • hasOwner

      boolean hasOwner()
      Checks to see if the skull has an owner.
      Returns:
      true if the skull has an owner
    • setOwner

      @Deprecated(since="1.12.1") boolean setOwner(@Nullable String owner)
      Sets the owner of the skull.
      Parameters:
      owner - the new owner of the skull
      Returns:
      true if the owner was successfully set
    • getOwningPlayer

      @Nullable OfflinePlayer getOwningPlayer()
      Gets the owner of the skull.
      Returns:
      the owner if the skull
    • setOwningPlayer

      boolean setOwningPlayer(@Nullable OfflinePlayer owner)
      Sets the owner of the skull.

      Plugins should check that hasOwner() returns true before calling this plugin.

      Parameters:
      owner - the new owner of the skull
      Returns:
      true if the owner was successfully set
    • getOwnerProfile

      @Nullable PlayerProfile getOwnerProfile()
      Gets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.
      Returns:
      the profile of the owning player
    • setOwnerProfile

      void setOwnerProfile(@Nullable PlayerProfile profile)
      Sets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.

      The profile must contain both a unique id and a skin texture. If either of these is missing, the profile must contain a name by which the server will then attempt to look up the unique id and skin texture.

      Parameters:
      profile - the profile of the owning player
      Throws:
      IllegalArgumentException - if the profile does not contain the necessary information
    • setNoteBlockSound

      void setNoteBlockSound(@Nullable NamespacedKey noteBlockSound)
      Sets the sound to play if the skull is placed on a note block.
      Note: This only works for player heads. For other heads, see Instrument.
      Parameters:
      noteBlockSound - the key of the sound to be played, or null
    • getNoteBlockSound

      @Nullable NamespacedKey getNoteBlockSound()
      Gets the sound to play if the skull is placed on a note block.
      Note: This only works for player heads. For other heads, see Instrument.
      Returns:
      the key of the sound, or null
    • clone

      @NotNull SkullMeta clone()
      Specified by:
      clone in interface ItemMeta