Solved Deleting the block dropped aftera block break event?

Discussion in 'Plugin Development' started by Tehmaker, Apr 16, 2014.

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

    Tehmaker

    When a player breaks a block, he is rewarded with money, and the block drop should be deleted. I attempted to use:
    Code:
    e.getBlock().getDrops().clear();
    
    Where e is the variable for the event.

    However, this doesn't seem to work, and the block is still dropped, along with the player receiving the money. Am I using the wrong method, or am I using it improperly?
     
  2. Offline

    Forseth11

    Tehmaker If any other plugin is effecting it then it will not work. You could try set drops or to be extra safe do delay then remove it after 1 tick. (remove all entities within 2 blocks)
     
    Tehmaker likes this.
  3. Offline

    Tehmaker

    Code:
    e.getBlock().setType(Material.AIR);
    
    This happens to work haha. Thanks for suggestion about setting things.
     
Thread Status:
Not open for further replies.

Share This Page