Pick Block Pro

Pick Block Pro

14.2k Downloads

Suggestion: get heads from the GameProfile

Zailer43 opened this issue ยท 1 comments

commented

if (entity instanceof PlayerEntity player) {
item = new ItemStack(Items.PLAYER_HEAD);
item.getOrCreateNbt().putString("SkullOwner", player.getEntityName());
}

If instead of obtaining the head from the username you obtain it from the GameProfile you can have better compatibility in case it is a non-premium server and users use skin with /skin

item = new ItemStack(Items.PLAYER_HEAD);
NbtCompound skullOwner = new NbtCompound();
NbtHelper.writeGameProfile(skullOwner, player.getGameProfile());
item.setSubNbt(SkullItem.SKULL_OWNER_KEY, skullOwner);
commented

Thank you for the suggestion, that sounds like a good idea. I will implement that soon, or if you like you can also make a PR for it.