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

Making explosive snowballs.

Discussion in 'Help' started by MalakasPlayzMCPE, Mar 31, 2018.

  1. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    I tried the ProjectileHitEvent, the ProjectileHitBlockEvent and the ProjectileHitEntityEvent and the EntityDespawnEvent. None of them worked. How to make exploasive snowballs?
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    show attempts of your code
     
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    PHP:
    public function onProjectileHitBlock(ProjectileHitBlockEvent $event){
      if(
    $event->getEntity() instanceof Snowball){
        
    $x $event->getEntity()->getX();
        
    $y $event->getEntity()->getY();
        
    $z $event->getEntity()->getZ();

        
    $explosion = new Explosion(new Position($x$y$z$event->getEntity()->getLevel()), 4);
        
    $explosion->explodeB();
      }
    }
     
    Last edited: Apr 1, 2018
  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.