PHP: public function handle(ProjectileHitEvent $event){$entity = $event->getEntity();if ($entity instanceof /*Arrow???*/) { $theX = $entity->getX(); $theY = $entity->getY(); $theZ = $entity->getZ(); $level = $entity->getLevel(); $thePosition = new Position($theX, $theY, $theZ, $level); $theExplosion = new Explosion($thePosition, 5, NULL); $theExplosion->explodeB(); $impact = 1; $damage = 1; }};
Why not do this? Theory. PHP: public function onShoot(EntityShootBowEvent $event){ $arrow = $event->getProjectile(); $position = $arrow->getPosition(); //Position class. $x = $position->getX(); $y = $position->getY(); $z = $position->getZ(); //etc.}
If you are getting position on EntityShootBowEvent it'll return position where the arrow was shot, you have to do it on ProjectileHitEvent instead.