How to remove item drop from block if player destroyed it?

Discussion in 'Plugin Development' started by Ibas, Jul 16, 2013.

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

    Ibas

    Hello,

    How to remove item drop from block if player destroyed it?
     
  2. Offline

    xTrollxDudex

    Ibas
    Listen for block break event set cancelled and set to air
     
  3. Offline

    Ibas

    Hm, could you provide code ;x?
     
  4. Offline

    Harry5573

    Code:
    @EventHandler
    public void onBreak(BlockBreakEvent e) {
    e.setCancelled(true);
    e.getBlock().setType(Material.AIR);
    }
    This might work dont have access to an IDE right not. If not use the one below

    Code:
    @EventHandler
    public void onBreak(BlockBreakEvent e) {
    e.getDrops.removeAll(e.getDrops());
    }
     
Thread Status:
Not open for further replies.

Share This Page