NMS Packet Manipulation

Discussion in 'Plugin Development' started by ShowbizLocket61, Jan 25, 2016.

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

    ShowbizLocket61

    Hey,
    I want to know if there's any way to manipulate packets, other than just creating and sending them.

    For a PacketPlayOutNamedSoundEffect, I want to know if I could change its location, pause it, play it, or even play it from a certain time in(ie. the middle)

    For a PacketPlayOutWorldParticles, I want to know if I could set its lifetime, or remove them.

    Is there some website with everything there is to know about NMS Packets? It would be very helpful.
     
  2. Offline

    Zombie_Striker

    @ShowbizLocket61
    Sadly, no. You can change values of packets once they are created. You can you ProtocolLib which will destroy and create the packets you want.

    Nope. There is no way to send this information.

    Nope. There is also no way to send this information either.
     
  3. Offline

    mythbusterma

    @ShowbizLocket61

    All a packet actually is is one quantum of network data. "Packet" has its definition bastardized by Minecraft, as it will send what it calls "packets" as different things the server and player do, but they have little correlation to the actual packets that are sent across the network.

    For example, multiple, smaller Minecraft "packets" may be grouped together into one larger packet, assuming they're headed for the same destination, and likewise a single "packet" may be split across multiple network packets.

    A key thing to understand about Minecraft is the only information that can be sent between the client and server is the information quantified by the packets defined in the protocol, all of which are listed here: wiki.vg If the information is not available in one of those packets, it cannot be acquired or sent.

    For example, with the particle packet, there is no "duration" (or equivalent) field, and, as such, you can't change how long the particle lasts.

    Also, the only reason they're associated with NMS is the fact that the networking code is inside NMS and it doesn't actually have much to do with the actual NMS code.
     
  4. Offline

    ShowbizLocket61

  5. Offline

    Konato_K

    @ShowbizLocket61 What do you mean by destroying packets? They are just information, it can be sent or not.
     
  6. Offline

    mythbusterma

    @ShowbizLocket61

    The are simply quanta of information sent between the server and client. What do you mean by "destroy" them?

    The most literal interpretation of that would be that it was destroyed in-flight (i.e. a packet bound for the server never reached it or vice-versa). This happens quite frequently and is referred to as "packet loss," and TCP will automatically compensate for this via retransmission (yes, Minecraft uses TCP for real-time applications...).

    I'm assuming you meant not sending or not handling them, however. On the client side, it is possible to ignore packets, not respond to them, or not send control packets. A lot of those are ways that clients cheat.

    On the server, it's possible to do the same. Ignoring packets is usually refereed to as "dropping" them (or "dropping them on the floor"), or did you mean just not sending certain packets.

    Both of which are possible with ProtocolLib, by cancelling the even associated with the packet (I believe, I've never used that particular plugin). But there are other ways to do it.
     
    shades161 likes this.
  7. Offline

    ShowbizLocket61

    @mythbusterma
    Take, for example, a packet which represents a particle. What handles the longevity of it? The client or the server? Once it has been sent, and the particle is being played by the client, is there a way to either send another packet to cancel that particle, directly force the client to drop it, etc?
     
  8. Offline

    mythbusterma

Thread Status:
Not open for further replies.

Share This Page