Send block break/place to player with ProtocolLib

Discussion in 'Plugin Development' started by sd5, Dec 14, 2014.

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

    sd5

    Hi, I'm very new to ProtocolLib and I'm wondering how I can send a block break oder block place packet to the client. I actually want the player to destroy a block, the server confirms it but then cancels the event, so the player thinks the block is destroyed but on the server nothing really happens. Does anyone know how to do this?

    I searched for some detailed ProtocolLib documentation or tutorial, but didn't really find anything, so if anyone does know something like this, let me know please :)
     
  2. #Player.sendBlockChange
     
  3. Offline

    sd5

    Thank you!

    But how would it work with other things, like killing an animal? How could I fake that to the player?

    I see that sendBlockChange is deprecated, so I tried to send a block change packet with ProtocolLib to the player. First modifer is a BlockPosition, but what it the second one? I guess it should be the block itself but doing packet.getBlocks() returns me an empty list? How is the block stored in this packet?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
Thread Status:
Not open for further replies.

Share This Page