Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Special Explosion

Comments in 'Plugin Development' started by Marcelo234, Apr 23, 2016.

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    A TNT explode and take damage on players and destroy a few blocks.....
    1) How is this event called?
    2) How I can Code this that only special blocks (for Exampel glass blocks) Will destroyed?
    Thanks Marcelo234
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    PHP:
    $e = new Explosion();
    $e->explodeA();
    than you should handle EntityExplodeEvent and there you can add or remove affected blocks, and for entities handle EntityDamageEvent and cancel it if cause is explosion
    Primus likes this.
  3. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    But how to make that only the glass blocks will destroy?
    Maybe there is a function $event->GetDestroyedBlocks()???
  4. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    yes there is

Share This Page

Advertisement