Class SkullUtils
Skull Meta: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/SkullMeta.html Mojang API: https://wiki.vg/Mojang_API
Some websites to get custom heads:
- https://minecraft-heads.com/
The basic premise behind this API is that the final skull data is contained in a GameProfile
either by ID, name or encoded textures URL property.
Different versions of Minecraft client handle this differently. In newer versions the client seem to prioritize the texture property over the set UUID and name, in older versions however using the same UUID for all GameProfiles caused all skulls (that use base64) to look the same. The client is responsible for caching skull textures. If the download were to fail (either because of connection issues or invalid values) the client will cache that skull UUID and the skull will remain as a steve head until the client is completely restarted. I don't know if this cache system works across other servers or is just specific to one server.
- Version:
- 6.0.0.1
- Author:
- Crypto Morin
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final MethodHandle
protected static final MethodHandle
protected static final MethodHandle
protected static final MethodHandle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.meta.SkullMeta
static org.bukkit.inventory.meta.SkullMeta
static org.bukkit.inventory.meta.SkullMeta
applySkin
(org.bukkit.inventory.meta.ItemMeta head, org.bukkit.OfflinePlayer identifier) static com.mojang.authlib.GameProfile
detectProfileFromString
(String identifier) static com.cryptomorin.xseries.SkullUtils.StringSkullCache
detectSkullValueType
(String identifier) static String
encodeTexturesURL
(String url) static String
getSkinValue
(org.bukkit.inventory.meta.ItemMeta skull) static org.bukkit.inventory.ItemStack
static com.mojang.authlib.GameProfile
profileFromBase64
(String base64, String MojangSHA) static com.mojang.authlib.GameProfile
profileFromPlayer
(org.bukkit.OfflinePlayer player) static void
static org.bukkit.inventory.meta.SkullMeta
setSkullBase64
(org.bukkit.inventory.meta.SkullMeta head, String value, String MojangSHA)
-
Field Details
-
CRAFT_META_SKULL_PROFILE_GETTER
-
CRAFT_META_SKULL_PROFILE_SETTER
-
CRAFT_META_SKULL_BLOCK_SETTER
-
PROPERTY_GETVALUE
-
-
Constructor Details
-
SkullUtils
public SkullUtils()
-
-
Method Details
-
getSkull
-
applySkin
-
applySkin
-
applySkin
@Nonnull public static org.bukkit.inventory.meta.SkullMeta applySkin(@Nonnull org.bukkit.inventory.meta.ItemMeta head, @Nonnull String identifier) - Parameters:
identifier
- Can be a player name, player UUID, Base64, or a minecraft.net skin link.
-
setSkullBase64
-
profileFromBase64
-
profileFromPlayer
@Nonnull public static com.mojang.authlib.GameProfile profileFromPlayer(org.bukkit.OfflinePlayer player) -
detectProfileFromString
-
detectSkullValueType
-
setSkin
-
encodeTexturesURL
-
getSkinValue
-