How do I send an item packet to a player using ProtocolLib?

Discussion in 'Plugin Development' started by Nax, Jul 14, 2014.

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

    Nax

    I'm trying to send an item to a players inventory using ProtocolLib, an arrow to be specific. Just wondering if anyone can help me figure this out. Thanks.

    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    ResultStatic

    Nax i dont think you need to use protocollib to SEND packets but to listen.
    PacketPlayOutWindowItems i think is the packet they use to send updates to inventories. it has a field ItemStack[] b, which it deserializes the nbt and sends to the player.

    so you could do PacketPlayOutWindowItems p = new PacketPlayOutWindowItems();
    then use reflection to get the private field and set it to whatever you want. tahg me if you want an example of the reflection
     
Thread Status:
Not open for further replies.

Share This Page