Per Player Skulls

Discussion in 'Spigot Plugin Development' started by _Nickk, Jul 1, 2016.

  1. Hello. I am writing a plugin where each player will see a skull block as their own. Here is my current code:

    Code (Text):
            BlockState state = head.getState();
            Skull skull = (Skull) state;

            PacketPlayOutTileEntityData skullPacket = ((CraftSkull)skull).getTileEntity().getUpdatePacket();
            try {
                Field nbt = skullPacket.getClass().getDeclaredField("c");
                NBTTagCompound comp = (NBTTagCompound) nbt.get(skullPacket);

                comp.setString("Owner", username);

            } catch (NoSuchFieldException e) {
            } catch (IllegalAccessException e) {
    This code is not working, as the skull appears as a steve head.
  2. With that method I'd be getting a skull item. I'm looking to make a skull that is placed in the world look like the person who is viewing it.
  3. Woops, sorry!
  4. Np, thanks though.