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

Lightning Projectile

Comments in 'Plugin Development' started by Skullex, Apr 9, 2016.

  1. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    This is not working, please assist me with my errors

    Code:
    [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\entity\ProjectileHitEvent' to 'ExplosiveLightProjectiles v1.0.0 Alpha': Call to undefined method pocketmine\event\entity\ProjectileHitEvent::getPlayer() on ExplosiveProjectiles\EventHandler
    [17:27:36] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\event\entity\ProjectileHitEvent::getPlayer()" (EXCEPTION) in "/LightningProjectiles-master/src/ExplosiveProjectiles/EventHandler" at line 62
    
    PHP:
    public function onProjectileHit(ProjectileHitEvent $event){
            if(
    in_array($event->getEntity()->getId(), $this->canExplode) && $event->getEntity()->isCollided){
                unset(
    $this->canExplode[$event->getEntity()->getId()]);
                
    $explosion = new Explosion($event->getEntity()->getPosition(), $this->plugin->getConfig()->get("explosionsize"20));
                if(
    $this->plugin->getConfig()->get("breakBlocks")){
                    
    $explosion->explodeA();
                }
                
    $player $event->getPlayer();
                
    $explosion->explodeB();
                
    $level $player->getLevel();
                
    $event->getEntity()->kill();
                
    $light = new AddEntityPacket();
                
    $light->type 93;
                
    $light->eid Entity::$entityCount++;
                
    $light->metadata = array();
                
    $light->speedX 0;
                
    $light->speedY 0;
                
    $light->speedZ 0;
                
    $light->yaw $player->getYaw();
                
    $light->pitch $player->getPitch();
                
    $light->$player->x;
                
    $light->$player->y;
                
    $light->$player->z;
                foreach(
    $level->getPlayers() as $player){
                    
    $player->dataPacket($light);
                }
            }
        }
    }
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    $shooter $event->getEntity()->shootingEntity;
    PocketKiller and Skullex like this.

Share This Page

Advertisement