Class SkullCreator

java.lang.Object
valorless.valorlessutils.skulls.SkullCreator

public class SkullCreator extends Object
A library for the Bukkit API to create player skulls from names, base64 strings, and texture URLs.

Does not use any NMS code, and should work across all versions.

Author:
deanveloper on 12/28/2016.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    blockWithBase64(org.bukkit.block.Block block, String base64)
    Sets the block to a skull with the skin for the base64 string.
    static void
    blockWithName(org.bukkit.block.Block block, String name)
    Deprecated.
    names don't make for good identifiers.
    static void
    blockWithUrl(org.bukkit.block.Block block, String url)
    Sets the block to a skull with the skin found at the provided mojang URL.
    static void
    blockWithUuid(org.bukkit.block.Block block, UUID id)
    Sets the block to a skull with the given UUID.
    static org.bukkit.inventory.ItemStack
    Creates a player skull, should work in both legacy and new Bukkit APIs.
    static org.bukkit.inventory.ItemStack
    Creates a player skull item with the skin based on a base64 string.
    static org.bukkit.inventory.ItemStack
    Deprecated.
    names don't make for good identifiers.
    static org.bukkit.inventory.ItemStack
    Creates a player skull item with the skin at a Mojang URL.
    static org.bukkit.inventory.ItemStack
    Creates a player skull item with the skin based on a player's UUID.
    static org.bukkit.inventory.ItemStack
    itemWithBase64(org.bukkit.inventory.ItemStack item, String base64)
    Modifies a skull to use the skin based on the given base64 string.
    static org.bukkit.inventory.ItemStack
    itemWithName(org.bukkit.inventory.ItemStack item, String name)
    Deprecated.
    names don't make for good identifiers.
    static org.bukkit.inventory.ItemStack
    itemWithUrl(org.bukkit.inventory.ItemStack item, String url)
    Modifies a skull to use the skin at the given Mojang URL.
    static org.bukkit.inventory.ItemStack
    itemWithUuid(org.bukkit.inventory.ItemStack item, UUID id)
    Modifies a skull to use the skin of the player with a given UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createSkull

      public static org.bukkit.inventory.ItemStack createSkull()
      Creates a player skull, should work in both legacy and new Bukkit APIs.
    • itemFromName

      public static org.bukkit.inventory.ItemStack itemFromName(String name)
      Deprecated.
      names don't make for good identifiers.
      Creates a player skull item with the skin based on a player's name.
      Parameters:
      name - The Player's name.
      Returns:
      The head of the Player.
    • itemFromUuid

      public static org.bukkit.inventory.ItemStack itemFromUuid(UUID id)
      Creates a player skull item with the skin based on a player's UUID.
      Parameters:
      id - The Player's UUID.
      Returns:
      The head of the Player.
    • itemFromUrl

      public static org.bukkit.inventory.ItemStack itemFromUrl(String url)
      Creates a player skull item with the skin at a Mojang URL.
      Parameters:
      url - The Mojang URL.
      Returns:
      The head of the Player.
    • itemFromBase64

      public static org.bukkit.inventory.ItemStack itemFromBase64(String base64)
      Creates a player skull item with the skin based on a base64 string.
      Parameters:
      base64 - The Base64 string.
      Returns:
      The head of the Player.
    • itemWithName

      @Deprecated public static org.bukkit.inventory.ItemStack itemWithName(org.bukkit.inventory.ItemStack item, String name)
      Deprecated.
      names don't make for good identifiers.
      Modifies a skull to use the skin of the player with a given name.
      Parameters:
      item - The item to apply the name to. Must be a player skull.
      name - The Player's name.
      Returns:
      The head of the Player.
    • itemWithUuid

      public static org.bukkit.inventory.ItemStack itemWithUuid(org.bukkit.inventory.ItemStack item, UUID id)
      Modifies a skull to use the skin of the player with a given UUID.
      Parameters:
      item - The item to apply the name to. Must be a player skull.
      id - The Player's UUID.
      Returns:
      The head of the Player.
    • itemWithUrl

      public static org.bukkit.inventory.ItemStack itemWithUrl(org.bukkit.inventory.ItemStack item, String url)
      Modifies a skull to use the skin at the given Mojang URL.
      Parameters:
      item - The item to apply the skin to. Must be a player skull.
      url - The URL of the Mojang skin.
      Returns:
      The head associated with the URL.
    • itemWithBase64

      public static org.bukkit.inventory.ItemStack itemWithBase64(org.bukkit.inventory.ItemStack item, String base64)
      Modifies a skull to use the skin based on the given base64 string.
      Parameters:
      item - The ItemStack to put the base64 onto. Must be a player skull.
      base64 - The base64 string containing the texture.
      Returns:
      The head with a custom texture.
    • blockWithName

      @Deprecated public static void blockWithName(org.bukkit.block.Block block, String name)
      Deprecated.
      names don't make for good identifiers.
      Sets the block to a skull with the given name.
      Parameters:
      block - The block to set.
      name - The player to set it to.
    • blockWithUuid

      public static void blockWithUuid(org.bukkit.block.Block block, UUID id)
      Sets the block to a skull with the given UUID.
      Parameters:
      block - The block to set.
      id - The player to set it to.
    • blockWithUrl

      public static void blockWithUrl(org.bukkit.block.Block block, String url)
      Sets the block to a skull with the skin found at the provided mojang URL.
      Parameters:
      block - The block to set.
      url - The mojang URL to set it to use.
    • blockWithBase64

      public static void blockWithBase64(org.bukkit.block.Block block, String base64)
      Sets the block to a skull with the skin for the base64 string.
      Parameters:
      block - The block to set.
      base64 - The base64 to set it to use.