Break blocks like players?

Discussion in 'Plugin Development' started by russjr08, Jun 12, 2013.

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

    russjr08

    I'd like to be able to break blocks however, when broken I want them to display the breaking particles. I've seen this done by other plugins... Just always wondered how they do it. Anyone know how they do it?
     
  2. Code:java
    1. // Effect only!
    2. block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
    3.  
    4. // Like a player
    5. block.breakNaturally();
    6.  
    7. // Like a player with no drops
    8. block.setTypeId(0);
    9. block.setData((byte) 0);
    10. block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
     
    Wizardo367 likes this.
Thread Status:
Not open for further replies.

Share This Page