Class SkullBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.SkullBuilder

public class SkullBuilder extends ItemBuilder
The SkullBuilder class extends ItemBuilder to provide additional functionality for modifying SkullMeta of an ItemStack. This includes setting player owners and custom textures.
  • Constructor Details

    • SkullBuilder

      public SkullBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Constructs a SkullBuilder using an existing ItemStack.
      Parameters:
      itemStack - the item stack to modify
      Throws:
      IllegalArgumentException - if the item is not a PLAYER_HEAD
    • SkullBuilder

      public SkullBuilder(int amount)
      Constructs a SkullBuilder with a PLAYER_HEAD item.
      Parameters:
      amount - the quantity of items in the stack
  • Method Details

    • setOwner

      public SkullBuilder setOwner(@NotNull @NotNull org.bukkit.OfflinePlayer player)
      Sets the owner of the skull.
      Parameters:
      player - the offline player whose head will be used
      Returns:
      this SkullBuilder instance for chaining
    • setSkullTexture

      public SkullBuilder setSkullTexture(@NotNull @NotNull String base64Texture)
      Sets the custom texture of the skull using a Base64 string.
      Parameters:
      base64Texture - the Base64-encoded texture string
      Returns:
      this SkullBuilder instance for chaining
    • getSkullTexture

      @Nullable public @Nullable String getSkullTexture()
      Gets the custom texture of the skull as a Base64 string.
      Returns:
      the Base64-encoded texture string, or null if not set
    • removeSkullTexture

      public SkullBuilder removeSkullTexture()
      Removes the custom texture from the skull.
      Returns:
      this SkullBuilder instance for chaining