Package org.bukkit.inventory.meta
Interface SkullMeta
- All Superinterfaces:
Cloneable
,ConfigurationSerializable
,ItemMeta
,PersistentDataHolder
,PersistentDataViewHolder
Represents a skull that can have an owner.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Gets the sound to play if the skull is placed on a note block.getOwner()
Deprecated.Deprecated.Gets the owner of the skull.If the skull has an owner, perhasOwner()
, return the ownersPlayerProfile
boolean
hasOwner()
Checks to see if the skull has an owner.void
setNoteBlockSound
(@Nullable NamespacedKey noteBlockSound) Sets the sound to play if the skull is placed on a note block.boolean
Deprecated.void
setOwnerProfile
(@Nullable PlayerProfile profile) Deprecated.boolean
Sets the owner of the skull.void
setPlayerProfile
(PlayerProfile profile) Sets this skull to use the supplied Player Profile, which can include textures already prefilled.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
Methods inherited from interface org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDamageResistant, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippable, getFood, getItemFlags, getItemModel, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getLoreComponents, getMaxStackSize, getPlaceableKeys, getRarity, getTool, getTooltipStyle, getUseCooldown, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDamageResistant, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippable, hasFood, hasItemFlag, hasItemModel, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasPlaceableKeys, hasRarity, hasTool, hasTooltipStyle, hasUseCooldown, hasUseRemainder, isFireResistant, isGlider, isHideTooltip, isUnbreakable, itemName, itemName, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDamageResistant, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setEnchantable, setEnchantmentGlintOverride, setEquippable, setFireResistant, setFood, setGlider, setHideTooltip, setItemModel, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setLoreComponents, setMaxStackSize, setPlaceableKeys, setRarity, setTool, setTooltipStyle, setUnbreakable, setUseCooldown, setUseRemainder, setVersion
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
Method Details
-
getOwner
Deprecated.seegetOwningPlayer()
.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.Sets the owner of the skull.- Parameters:
owner
- the new owner of the skull- Returns:
- true if the owner was successfully set
-
setPlayerProfile
Sets this skull to use the supplied Player Profile, which can include textures already prefilled.- Parameters:
profile
- The profile to set this Skull to use, or null to clear owner
-
getPlayerProfile
If the skull has an owner, perhasOwner()
, return the ownersPlayerProfile
- Returns:
- The profile of the owner, if set
-
getOwningPlayer
Gets the owner of the skull.- Returns:
- the owner if the skull
-
setOwningPlayer
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
Deprecated.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
Deprecated.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
Sets the sound to play if the skull is placed on a note block.
Note: This only works for player heads. For other heads, seeInstrument
.- Parameters:
noteBlockSound
- the key of the sound to be played, or null
-
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, seeInstrument
.- Returns:
- the key of the sound, or null
-
clone
-
getOwningPlayer()
.