[skript-mirror] Player heads with textures

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dovias

New Member
Dec 8, 2019
6
1
0
27
Wanna get textured player heads without using SkNBeet addon?
No problem! You can do so using this expression, that i've made up for myself!

Code:
import:
  org.bukkit.Material
  org.bukkit.inventory.ItemStack
  org.bukkit.SkullType
  com.destroystokyo.paper.profile.ProfileProperty
  java.util.UUID
  org.bukkit.Bukkit

expression [%integer%] textured player head[s] with value %string%:
  return type: Item
  get:
    if expression-1 is set:
      set {_skull} to new ItemStack(Material.SKULL_ITEM and expression-1 and SkullType.PLAYER.ordinal())
    else:
      set {_skull} to new ItemStack(Material.SKULL_ITEM and 1 and SkullType.PLAYER.ordinal())
    set {_skullmeta} to {_skull}.getItemMeta()
    set {_UUID} to UUID.randomUUID()
    set {_playerprofile} to Bukkit.getServer().createProfile({_UUID})
    {_playerprofile}.setProperty(new ProfileProperty("textures" and "%expression-2%"))
    {_skullmeta}.setPlayerProfile({_playerprofile})
    {_skull}.setItemMeta({_skullmeta})
    return {_skull}

Examples:

Code:
command /example:
  trigger:
    give 5 textured player heads with value "texture value of player head." to event-player
    set slot 0 of expression-1's current inventory to textured player head with value "texture value of player head." named "Your display name of item" with lore "Your lore"

Requires:
  • Skript-mirror
  • PaperSpigot (You could do this in spigot too, but it would require some NMS stuff, which im too lazy to do, because i'm always using paper.)
 
Amazing! Thank you so much for this resource, I used it to get HD Airpods and many other skulls! Once again, thanks a bunch!
 
idk why the script dovias provided doesn't work
so i modified it to work with Skript-reflect (skript-mirror's fork)
and here's the modified version with the same features

Tested with :
- Paper 1.21.1-56-master@227c94a (MC 1.21.1)
- Skript 2.9.2
- Skript-reflect 2.5.1

Code:
import:
  org.bukkit.Material
  org.bukkit.inventory.ItemStack
  com.destroystokyo.paper.profile.ProfileProperty
  java.util.UUID
  org.bukkit.Bukkit

expression [%integer%] textured player head[s] with value %string%:
    return type: Item
    get:
        if expression-1 is set:
            set {_sk} to new ItemStack(Material.PLAYER_HEAD, expression-1)
        else:
            set {_sk} to new ItemStack(Material.PLAYER_HEAD, 1)
        set {_skm} to {_sk}.getItemMeta()
        set {_ID} to UUID.randomUUID()
        set {_p} to Bukkit.getServer().createProfile({_ID})
        {_p}.setProperty(new ProfileProperty("textures", "%expression-2%"))
        {_skm}.setPlayerProfile({_p})
        {_sk}.setItemMeta({_skm})
        return {_sk}

Example:

Code:
command /tesd:
    trigger:
        give 5 textured player heads with value "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWVmZDRjZmE5MTQzMzk4ZTExZWJjZTNmYjJlY2JiZjU2YTA3M2UzNTYzZjZlZjZhY2FlNGNiNzM5N2U1ODhiMiJ9fX0" to player

You can get the value from minecraft-heads.com

Dependencies:
-
Skript ofc
- Skript-Reflect
- Paper server

Note* i dont really understand what NMS is, since i never code an actual minecraft plugins, so if this doesnt work, or the skull doesnt have the desired texture, try this on a paper server.
 
Last edited: