Solved PacketPlayOutTileEntityData NBTTag help

Discussion in 'Plugin Development' started by jlin13, Nov 21, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    jlin13

    Quick question, how do I format the NBTTagCompound object to set the rotation and skin of the mob head?

    Here's what I have so far:
    Code:
    @Override
        public void setHead(Player p, Location zLoc) {
            NBTTagCompound skinData = new NBTTagCompound();
            // Set skin data here
            BlockPosition blockPos = new BlockPosition(zLoc.getBlockX(), zLoc.getBlockY(), zLoc.getBlockZ());
            PacketPlayOutTileEntityData packet = new PacketPlayOutTileEntityData(blockPos, 4, skinData);
            // 4: Set rotation and skin of mob head
            ((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet);
        }
    Here's my reference: http://wiki.vg/Protocol#Update_Block_Entity
    • 4: Set rotation and skin of mob head

    EDIT: Used skulls instead lmao
     
    Last edited: Nov 21, 2016
Thread Status:
Not open for further replies.

Share This Page