Send packet to entity

Discussion in 'Spigot Plugin Development' started by xXCalleManXx, Feb 14, 2016.

  1. Hi
    Im new with packets and was thinking about how to send packets to a specific entity.
    Iknow i can send a packet to a player by this:
    Code (Text):
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    Thats just a player, what about a entity?
     
  2. Serializator

    Supporter

    Entities can't receive packets, learn more about them in a general way before using them.
     
    • Agree Agree x 1
  3. Assuming you know the basics of java as well as the basics of networking, this site really contains all the information you need:
    http://wiki.vg/Protocol
     
    • Like Like x 1
  4. Creeoer

    Supporter

    Considering using the Minecraft protocol on your own for the first time can be rather frustrating when trying to maintain, you could try using protocollib to get a feel for packet handling while not having the stress to constantly have to change your methods every version change.
     
    • Agree Agree x 2
    • Informative Informative x 1