Package dev.oumaimaa.kawaiiapi.heads
Class SkullCreator
java.lang.Object
dev.oumaimaa.kawaiiapi.heads.SkullCreator
Modern library for creating custom player skulls using Paper's Profile API.
Provides non-NMS methods for setting skull textures from UUIDs, URLs, and base64 data.
This implementation is fully compatible with Paper 1.21+ and uses only stable APIs.
- Version:
- 1.0
- Author:
- KawaiiDevelopment
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidblockWithBase64(@NotNull org.bukkit.block.Block block, @NotNull String base64) Sets a block to a player skull with a base64 encoded texture.static voidblockWithUrl(@NotNull org.bukkit.block.Block block, @NotNull String url) Sets a block to a player skull with a texture from a Mojang URL.static voidblockWithUuid(@NotNull org.bukkit.block.Block block, @NotNull UUID uuid) Sets a block to a player skull with the specified UUID.static @NotNull org.bukkit.inventory.ItemStackitemFromBase64(@NotNull String base64) Creates a player skull ItemStack from a base64 encoded texture string.static @NotNull org.bukkit.inventory.ItemStackitemFromUrl(@NotNull String url) Creates a player skull ItemStack from a Mojang texture URL.static @NotNull org.bukkit.inventory.ItemStackitemFromUuid(@NotNull UUID uuid) Creates a player skull ItemStack from a player's UUID.static @NotNull org.bukkit.inventory.ItemStackitemWithBase64(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String base64) Applies a base64 encoded texture to an existing skull ItemStack.static @NotNull org.bukkit.inventory.ItemStackitemWithUrl(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String url) Applies a texture from a Mojang URL to an existing skull ItemStack.static @NotNull org.bukkit.inventory.ItemStackitemWithUuid(@NotNull org.bukkit.inventory.ItemStack item, @NotNull UUID uuid) Applies a player's texture to an existing skull ItemStack using their UUID.
-
Method Details
-
itemFromUuid
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemFromUuid(@NotNull @NotNull UUID uuid) Creates a player skull ItemStack from a player's UUID.- Parameters:
uuid- The player's UUID- Returns:
- ItemStack with the player's head texture
-
itemWithUuid
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemWithUuid(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull UUID uuid) Applies a player's texture to an existing skull ItemStack using their UUID.- Parameters:
item- The skull ItemStack to modify (must be PLAYER_HEAD)uuid- The player's UUID- Returns:
- The modified ItemStack
- Throws:
IllegalArgumentException- if item is not a player head
-
itemFromUrl
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemFromUrl(@NotNull @NotNull String url) Creates a player skull ItemStack from a Mojang texture URL.- Parameters:
url- The full Mojang texture URL- Returns:
- ItemStack with the custom texture
-
itemWithUrl
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemWithUrl(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String url) Applies a texture from a Mojang URL to an existing skull ItemStack.- Parameters:
item- The skull ItemStack to modify (must be PLAYER_HEAD)url- The full Mojang texture URL- Returns:
- The modified ItemStack
- Throws:
IllegalArgumentException- if URL is invalid or item is not a player head
-
itemFromBase64
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemFromBase64(@NotNull @NotNull String base64) Creates a player skull ItemStack from a base64 encoded texture string.- Parameters:
base64- The base64 encoded texture data- Returns:
- ItemStack with the custom texture
-
itemWithBase64
@NotNull public static @NotNull org.bukkit.inventory.ItemStack itemWithBase64(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull String base64) Applies a base64 encoded texture to an existing skull ItemStack. Uses Paper's modern PlayerProfile API for reliable texture application.- Parameters:
item- The skull ItemStack to modify (must be PLAYER_HEAD)base64- The base64 encoded texture data- Returns:
- The modified ItemStack
- Throws:
IllegalArgumentException- if item is not a player head
-
blockWithUuid
public static void blockWithUuid(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull UUID uuid) Sets a block to a player skull with the specified UUID.- Parameters:
block- The block to convert to a skulluuid- The player's UUID- Throws:
IllegalStateException- if block cannot be converted to a skull
-
blockWithUrl
public static void blockWithUrl(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull String url) Sets a block to a player skull with a texture from a Mojang URL.- Parameters:
block- The block to convert to a skullurl- The Mojang texture URL- Throws:
IllegalArgumentException- if URL is invalidIllegalStateException- if block cannot be converted to a skull
-
blockWithBase64
public static void blockWithBase64(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull String base64) Sets a block to a player skull with a base64 encoded texture.- Parameters:
block- The block to convert to a skullbase64- The base64 encoded texture data- Throws:
IllegalStateException- if block cannot be converted to a skull
-