Advertisement
xeRicker

Untitled

Jun 13th, 2024
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. ItemStack headStack = new ItemStack(Material.PLAYER_HEAD);
  2. NBT.modify(headStack, nbt -> {
  3. final ReadWriteNBT skullOwnerCompound = nbt.getOrCreateCompound("SkullOwner");
  4.  
  5. // The owner UUID. Note that skulls with the same UUID but different textures will misbehave and only one texture will load.
  6. // They will share the texture. To avoid this limitation, it is recommended to use a random UUID.
  7. skullOwnerCompound.setUUID("Id", UUID.randomUUID());
  8.  
  9. skullOwnerCompound.getOrCreateCompound("Properties")
  10. .getCompoundList("textures")
  11. .addCompound()
  12. .setString("Value", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmU0NGQ1ZjZmMDI1YmM5N2YzNzAzNTJjMGU1ZDliMGU4MGFjMjIwN2Y3YzIyYzI2OGM5OGUxNDkyNzc3MGEzIn19fQ==");
  13. });
  14. player.getInventory().addItem(headStack);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement