How to tell when player has DESTROYED a block?

Discussion in 'Plugin Development' started by JMEYER, Jan 14, 2011.

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

    JMEYER

    Hey everyone,

    Looking through the "Event" class, I see we have a good number of listeners to work with, but how can I determine when a player has fully destroyed a block and not just damaged it.

    Many thanks,

    JMEYER

    EDIT:
    After a deeper look at the files I found "BlockDamagedLevel.java" what is the cleanest and safest way to implement this with "BlockDamagedEvent.java"?

    EDIT:
    Nevermind:
    Code:
    @Override
        public void onBlockDamaged(BlockDamagedEvent event) {
            if (event.getDamageLevel() == BlockDamageLevel.BROKEN) {
                event.getPlayer().sendMessage("You broke it!");
            }
        }
     
  2. Offline

    feverdream

    I have found that the source for Big Brother is a great way to find out these events.
     
Thread Status:
Not open for further replies.

Share This Page