getId() !== BlockLegacyIds::AIR and empty($block->getCollisionBoxes())){ //TODO: remove this once block collision boxes are fixed properly $pos = $block->getPos(); return AxisAlignedBB::one()->offset($pos->x, $pos->y, $pos->z)->calculateIntercept($start, $end); } return parent::calculateInterceptWithBlock($block, $start, $end); } protected function onHit(ProjectileHitEvent $event) : void{ $owner = $this->getOwningEntity(); if($owner !== null){ //TODO: check end gateways (when they are added) //TODO: spawn endermites at origin $this->getWorld()->addParticle($origin = $owner->getPosition(), new EndermanTeleportParticle()); $this->getWorld()->addSound($origin, new EndermanTeleportSound()); $owner->teleport($target = $event->getRayTraceResult()->getHitVector()); $this->getWorld()->addSound($target, new EndermanTeleportSound()); $owner->attack(new EntityDamageEvent($owner, EntityDamageEvent::CAUSE_FALL, 5)); } } }