Packet Error

Discussion in 'Plugin Development' started by xWatermelon, Jun 22, 2013.

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

    xWatermelon

    I am trying to make it so players auto-respawn, but it doesn't seem to work. In my PlayerDeathEvent, I call ((CraftPlayer) player).getHandle().playerConnection.sendPacket(getRespawnPacket()), but I get disconnected for "Internal exception: java.io.IOException: Bad packet id 205". What is wrong? This is my getRespawnPacket() method:
    Code:java
    1. private Packet205ClientCommand getRespawnPacket(){
    2. Packet205ClientCommand packet = new Packet205ClientCommand();
    3.  
    4. packet.a = (int) 1;
    5.  
    6. return packet;
    7. }
     
  2. Offline

    Eats_Rainbows

    This code has been floating around for a while.
    Code:
    Packet205ClientCommand packet = new Packet205ClientCommand();
    packet.a = 1;
    ((CraftPlayer)player).getHandle().playerConnection.a(packet);
    If it doesn't work just add a 1 second delay.
     
  3. Offline

    xWatermelon

    Eats_Rainbows that is exactly what I am doing and it doesn't work. I have added a delay, but it still disconnects me.
     
  4. Offline

    Eats_Rainbows

    I haven't used it in a while. Maybe iit is broken in the new API?
     
  5. Offline

    xWatermelon

  6. Offline

    naorpeled

    LOL I know that this is old but I`m having this problam.
     
  7. Offline

    chasechocolate

    naorpeled instead of calling sendPacket(), you need to call the a() method.
     
  8. Offline

    xTrollxDudex

    Or the other way around
     
  9. Offline

    chasechocolate

    xTrollxDudex for Packet205ClientCommand and a few other packets, it has to be called using a(packet) otherwise you will get the "Bad Packet ID" error.
     
  10. Offline

    xTrollxDudex

    Now I see why bukkit doesn't implement packet sending :p
     
Thread Status:
Not open for further replies.

Share This Page