[Closed] Packet Sending, Where to start?

Discussion in 'Plugin Development' started by iZanax, Sep 14, 2012.

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


    Packet Sending
    I want to learn about Packet Sending,
    but the information is pretty rare to find.
    So do you guys have tips and trick or sources that can help?
    For how they work and how they can be used?

    For now i just got Packet62NamedSoundEffect working.
    But other i can't find any information about them(252,14,108,12).
    And when i trail and error, it just gives me IOexceptions.
    So all sources/help are welcome!


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


    minecraft server source - has all packets in it, check mc-dev repo.
  3. Offline


    Okay, i've found the packets with the methodes and return.
    But how to use them is still a big question, and what they can do.
    For example:
                    Packet252KeyResponse packet = new Packet252KeyResponse();
                    event.getPlayer().sendMessage("Packet: "+packet);
    Result: Paccket: Packet252KeyResponse

    Could this packet, give me acces to what a player have pressed? Yes, How? No, what does it then?

    Source: https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/Packet252KeyResponse.java
  4. Offline


    That is for handling of the encryption key.
    It is not possible to get which keys a user has pressed without a modded client, unfortunately.
  5. Offline


    How do you know that, about packets, any sources ; ( ?

    Let me ask some question about packets, to see if its possible:
    1. Is it possible to change pitch of a player with https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/Packet12PlayerLook.java
    2.Is it possible to force a player to click with https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/Packet108ButtonClick.java
    3. What can i do with https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/Packet14BlockDig.java or/and dev/blob/master/net/minecraft/server/Packet55BlockBreakAnimation.java

    Thanks a lot!
  6. Offline


    You don't need to interact with packets to do these things, that is what the Bukkit API is for.
    1. Use player.setLocation(Location);
    2. I believe there is a player interact method, if not, I'm sure there's a void on the button that lets you do that.
    3. You can fake a block break.
  7. Offline


    Okay, let me explain:
    1. I need to change pitch without teleport that's why i search for an alternative.
    2. PlayerInteractEvent is there, but this detects only every 200ms, so i wanted to find a way to detect mouse clicks/hold
    3. That would be nice, i will search and hopely find something.
  8. Offline


    You don't have to teleport. I think you can do this: player.getLocation().setPitch(0);
  9. Offline


    This question has be answerd on my other thread.
    player.getLocation().setY(5); will not work as well.
    I just need teleport ; (

    So do someone know something about Packet12PlayerLook ?

    Could someone use, how i can use Packet12PlayerLook, i need to change pitch, is this possible with this packet?

    Packet12PlayerLook(float par1,float par2,boolean par3)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 28, 2016
  10. Offline


    I dont think you can change a player's look or location without a teleport.
    For packet informations, check out wiki.vg
  11. Offline


  12. Offline


    Please don't grave dig threads.
    swampshark19 likes this.
  13. Offline


    I'm giving him advice on how to set the pitch..

    Woops: I know what you mean now, sorry.
Thread Status:
Not open for further replies.

Share This Page