1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Creating explosions

Discussion in 'Development' started by DanielYTK, Mar 25, 2017.

  1. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    How to create an explosion that does not break blocks, plus damage
     
  2. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    So like, an explosion that kills players but doesn't destroy the environment?
     
  3. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    use Explosion.php,
    but only if you want dont destroy blocks
     
  4. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    vós
     
  5. Bluzzi

    Bluzzi Spider Jockey

    Messages:
    46
    Hello ! Here's a code that will work!
    PHP:
    public function addExplosion(Player $player$x$y$z){
        
    $lvl $player->getLevel();
        
    $pos = new Position($x$y$z$lvl);
        
    $explosion = new Explosion($pos6null);
        
    $explosion->explodeB();
        }
    Then put this code in the trigger for your explosion:
    PHP:
    $this->addExplosion($player$x$y$z);
     
    Last edited: Mar 27, 2017
    Primus, DanielYTK and Orlando092 like this.
  6. SkySeven

    SkySeven Baby Zombie

    Messages:
    145
    GitHub:
    SkySevenMC
    How do not drop item to explosion ?
     
  7. Primus

    Primus Zombie Pigman

    Messages:
    749
    Function parameters are too narrow. You can optimize this code
    PHP:
    public function addExplosion(Position $posint $force 6){
        
    $explosion = new Explosion($pos$forcenull);
        
    $explosion->explodeB();
    }
     
    Bluzzi and Sandertv like this.
  8. Bluzzi

    Bluzzi Spider Jockey

    Messages:
    46
    This type of explosion (EcxplosionB) does not break any block!
     
  9. SkySeven

    SkySeven Baby Zombie

    Messages:
    145
    GitHub:
    SkySevenMC
    bon on peut parler fr ?xD
    je sais mais le problème c que je veux quand meme les casser mais sans drops.
     
    Bluzzi likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.