How to send a packet to the client?

Discussion in 'Plugin Development' started by Adamki11s, Jun 7, 2011.

Thread Status:
Not open for further replies.
  1. I was wondering how to do this, I searched through past threads and there don't seem to be any exams and Bukkits API isn't very useful. Any help would be greatly appreciated, thanks.
     
    terrornerd likes this.
  2. Offline

    Crash

    Pretty sure you can do it this way :

    Code:
    ((CraftPlayer)player).getHandler().netServerHandler.sendPacket( packet );
    
     
  3. Alright that looks good thank you. For the packet what would I put?
    Would it just be something like:
    PHP:
    ((CraftPlayer)player).getHandler().netServerHandler.sendPacket(Packet51MapChunk);//For example?
     
  4. Offline

    Crash

    Code:
    Packet51MapChunk packet = new Packet51MapChunk(...);
    ((CraftPlayer)player).getHandler().netServerHandler.sendPacket(packet);
     
  5. Thank you, I realise this may be fustrating but I've never ever handled these packets before so would you mind telling me what to put inside the ... Thank you.
     
  6. Offline

    Shamebot

    Look in mc-dev and the modified minecraft code from craftbukkit
     
  7. Link?
     
  8. Offline

    Crash

    Pretty sure it's this:
    Code:
    new Packet51MapChunk( x, y, z, sizex, sizey, sizez, world);
    
    sizex and sizez should be 15 and sizey should be 127
     
  9. Offline

    DreadKyller

    so @Adamki11s you're trying to make a force chunk load plugin?
     
  10. Offline

    Shamebot

  11. Not really, I see why you got that assumption though :p
    Someone requested it a while ago as I get annoyed with teleporting and every chunk loads except the one I'm standing on. I managed to update on the server but I needed a way to force the client to update.

    I really just want to know how to do this for future reference though.
     
  12. Offline

    DreadKyller

    exactly, a force chunk load plugin, lol.

    "force the client to update."
     
  13. I'm not actually making it a plugin I'm just learning how to do it....
     
  14. Offline

    DreadKyller

    Oh, well now you know :) somewhat
     
  15. Offline

    nickguletskii

Thread Status:
Not open for further replies.

Share This Page