Explode not destroy blocks

Discussion in 'Plugin Development' started by Razdom, Nov 3, 2013.

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

    Razdom

    How can i do explode not destroy blocks but destroy health?
     
  2. Offline

    Coelho

  3. Offline

    maxben34

    Make an EntityExplodeEvent and e.setCancelled() (i think)
     
  4. Offline

    Coelho

    Or you could do (think outside the box):
    Code:
    event.blockList().clear();
    
     
  5. Offline

    maxben34

    True. I think cancelling the event would be less laggy for larger explosions however.
     
  6. Offline

    Coelho

    I'm just going to stop you there and say no.
     
  7. Offline

    maxben34

    Why's that?
     
  8. Offline

    Coelho

  9. Offline

    maxben34

  10. Offline

    Coelho

    It is not that it is more efficient. It is that it is more correct and comparatively not significantly slower.
     
  11. Offline

    maxben34

    Oh okay. I understand why it's more correct. Thanks :)
     
  12. Offline

    skore87

    The block/shadow updates and spawning of entities is what would tax the system more than an explosion graphic. It is simplest to keep the actual explosion event minus the block damage instead of trying to calculate if an entity is to be damaged, how much, and be pushed in what direction and velocity.
     
Thread Status:
Not open for further replies.

Share This Page