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

~TNT~

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

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hey Guys....
    1) If A TNT explode only the glass blocks should be destroyed (How to Do?)
    2) to use this what I must use?
    ExplodeA or ExplodeB??
    Thanks in advance...
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    PHP:
    public function onExplode(EntityExplodeEvent $event){
     
    $block $event->getBlockList();
     foreach (
    $block as $blocks){
      if (!
    $blocks instanceof Grass){
       unset(
    $block[array_search($blocks$block)]);
      }
     }
     
    $event->setBlockList($block);
    }
    MyNameIsTriXz and CookieSteve like this.

Share This Page

Advertisement