xeRicker

Untitled

Jun 14th, 2024 (edited)
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public static ItemStack headFromTexture(String value) {
  2. ItemStack itemStack = new ItemStack(Material.PLAYER_HEAD);
  3. NBT.modifyComponents(itemStack, nbt -> {
  4. ReadWriteNBT profileCompound = nbt.getOrCreateCompound("profile");
  5. profileCompound.setUUID("id", UUID.randomUUID());
  6.  
  7. ReadWriteNBT propertiesCompound = profileCompound.getCompoundList("properties").addCompound();
  8. propertiesCompound.setString("name", "textures");
  9. propertiesCompound.setString("value", value);
  10. });
  11. return itemStack;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment