Break block method?

Discussion in 'Plugin Development' started by Canownueasy, Apr 5, 2011.

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

    Canownueasy

    How would I call a block to break? (Not hook/handle a block break, but perform the breaking)
     
  2. Offline

    narrowtux

    Simply call block.setTypeId(0);
    This will set the type to air (this is breaking)
     
    Tim Visee likes this.
  3. Offline

    Canownueasy

    I knew about that option previously.
    But does it show it breaking (and play the sound)?
     
  4. Offline

    narrowtux

    Hm no, that would require to send fake packets to the clients (don't ask me how to do this exactly ;)
     
  5. Offline

    Canownueasy

    That's what I was thinking of.
     
  6. Offline

    Edward Hand

    That animation is clientside. There's no way for the server to replicate it. Think about when you get lag on SMP; the client breaks the block and shows the animation. When the block comes back and disappears again, you see no animation.
     
  7. Offline

    Canownueasy

    But...if a MC server environment was done under convention, should it not include processing OP codes for certain actions (as block breaking) which are received from the server?

    There is obviously a way to send packets server to client. Maybe not included in Bukkit, but all server environments must send updates which are [outward streams] toward each connected & active client.
     
  8. Offline

    Edward Hand

    Its tells the client when a block is removed, yes. That's not what triggers the animation though. The client decides when it should show the animation irrespective of when the block goes on the server.
     
  9. Offline

    Tim Visee

    Thanks! This works fine for me. :)
     
  10. Offline

    Canownueasy

    It's quite obvious. But I am saying that there is most likely a packet that is sent from server->client to break blocks.
     
  11. Offline

    Edward Hand

    Oh yeah thats simple.

    theBlock.setType(Material.AIR)
     
Thread Status:
Not open for further replies.

Share This Page