Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Packets

Comments in 'Plugin Development' started by Tethered_, Dec 12, 2014.

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

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    What are packets, how can I use them, and where can I view the different available "types" of packets?

    Sorry if this is really brief, I've seen them mentioned a lot here and don't understand them at all.
    xFlare likes this.
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Packets are the way that information flow between the client and the server, you can find different packets on the source code of PocketMine, or you can access HERE for a complete list of available packets, their description and where they're sent from (Ex. Client to Server, Server to Client or Both ways)

    As always, it is not recommendable to use them, you can break Server's functionality or not, but it is considered as a bad practice :p
    TigerHix and Tethered_ like this.
  3. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    That link is outdated. You can use packets if they are really needed or speed up something greatly. For example, I use packets in DisguiseMe and iControlU as there is no obvious way to accomplish these plugins without them. Packets are not considered to be "bad practice", they are much lower level than the standard API but they are abstracted to an extent (which means that the protocol can undergo some change without breaking the classes).
    TigerHix, PEMapModder and Tethered_ like this.
  4. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    So essentially in your plugin you use something like the MoveMobPacket and send it to connected players?
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes, but PocketMine won't know that you did this and will still consider the mob to be at that place before you sent the packets.
    iksaku likes this.
  6. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Bad practice! XD
  7. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,196
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    as long as it works :p
  8. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Shhhh! XD they should use API to get knowledge on what they're doing :p
    iJoshuaHD likes this.
  9. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,196
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    how could they use some PocketMine internal stuff if they cant even know the API's xD
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You send raw packets when you don't want PocketMine to know you sent that packet, like, in cases of fake entities (disguise), etc.
    TigerHix and iksaku like this.
  11. Samueljh1H8sLag
    Offline

    Samueljh1H8sLag Active Member

    Joined:
    Jun 20, 2015
    Posts:
    168
    Minecraft User:
    Samueljh1_
    which makes it FASTER
  12. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    You just bumped an old thread.
    jojoe77777 likes this.
  13. Samueljh1H8sLag
    Offline

    Samueljh1H8sLag Active Member

    Joined:
    Jun 20, 2015
    Posts:
    168
    Minecraft User:
    Samueljh1_
    lol didn't even realise it was 2014 xD
    jojoe77777 likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement