Class SkullBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.SkullBuilder
The
SkullBuilder class extends ItemBuilder to provide
additional functionality for modifying SkullMeta of an ItemStack.
This includes setting player owners and custom textures.-
Constructor Summary
ConstructorsConstructorDescriptionSkullBuilder(int amount) Constructs aSkullBuilderwith a PLAYER_HEAD item.SkullBuilder(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aSkullBuilderusing an existingItemStack. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringGets the custom texture of the skull as a Base64 string.Removes the custom texture from the skull.setOwner(@NotNull org.bukkit.OfflinePlayer player) Sets the owner of the skull.setSkullTexture(@NotNull String base64Texture) Sets the custom texture of the skull using a Base64 string.Methods inherited from class io.github.lucfr1746.llibrary.itemstack.ItemBuilder
addAttributeModifier, addEnchant, addEnchant, addEnchant, addItemFlags, addLore, build, getAmount, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippableComponent, getFoodComponent, getItemFlags, getItemMeta, getItemModel, getJukeboxPlayableComponent, getMaxStackSize, getRarity, getToolComponent, getTooltipStyle, getTranslationKey, getType, getUseCooldownComponent, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDamageResistant, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippableComponent, hasFoodComponent, hasItemFlag, hasItemModel, hasJukeboxPlayableComponent, hasMaxStackSize, hasRarity, hasToolComponent, hasTooltipStyle, hasUseCooldownComponent, hasUseRemainder, hideAllItemFlags, insertLore, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchants, removeItemFlags, replaceLore, setAmount, setAttributeModifiers, setCustomModelData, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippableComponent, setEquippableComponent, setFood, setFoodComponent, setGlider, setHideTooltip, setItemModel, setItemModel, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setLores, setLores, setMaxStackSize, setRarity, setToolComponent, setToolComponent, setTooltipStyle, setTooltipStyle, setType, setUnbreakable, setUseCooldownComponent, setUseCooldownComponent, setUseCooldownComponent, setUseRemainder
-
Constructor Details
-
SkullBuilder
public SkullBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aSkullBuilderusing an existingItemStack.- Parameters:
itemStack- the item stack to modify- Throws:
IllegalArgumentException- if the item is not a PLAYER_HEAD
-
SkullBuilder
public SkullBuilder(int amount) Constructs aSkullBuilderwith a PLAYER_HEAD item.- Parameters:
amount- the quantity of items in the stack
-
-
Method Details
-
setOwner
Sets the owner of the skull.- Parameters:
player- the offline player whose head will be used- Returns:
- this
SkullBuilderinstance for chaining
-
setSkullTexture
Sets the custom texture of the skull using a Base64 string.- Parameters:
base64Texture- the Base64-encoded texture string- Returns:
- this
SkullBuilderinstance for chaining
-
getSkullTexture
Gets the custom texture of the skull as a Base64 string.- Returns:
- the Base64-encoded texture string, or null if not set
-
removeSkullTexture
Removes the custom texture from the skull.- Returns:
- this
SkullBuilderinstance for chaining
-