Remove Falling Block Mid-Air?

Discussion in 'Plugin Development' started by seanliam2000, Jun 29, 2015.

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

    seanliam2000

    I am making a plugin for one of my friends that involves falling blocks ontop of mobs and when the mob becomes too far away I want to remove the mob AND the falling block, what happens is the mob get removed fine but the falling block falls to the ground AND THEN dissapears. Can I make the block dissapear as soon as it falls? Could it cause problems as it is a falling block on the mobs head?
    Code:java
    1.  
    2. @EventHandler
    3. public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {
    4. if (event.getEntityType() == EntityType.FALLING_BLOCK) {
    5. FallingBlock fallingBlock = (FallingBlock) event.getEntity();
    6. if (fallingBlock.getMaterial() == Material.WOOL) {
    7. event.setCancelled(true);
    8. }
    9. }
    10. }
    11.  


    What I have checks for when the block lands
     
  2. Offline

    Elimnator

    Just remove the fallingblock entity when you remove the mob.
     
Thread Status:
Not open for further replies.

Share This Page