getId() !== BlockLegacyIds::AIR and empty($block->getCollisionBoxes())){ //TODO: remove this once block collision boxes are fixed properly return AxisAlignedBB::one()->offset($block->x, $block->y, $block->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->world->addParticle($owner, new EndermanTeleportParticle()); $this->world->addSound($owner, new EndermanTeleportSound()); $owner->teleport($target = $event->getRayTraceResult()->getHitVector()); $this->world->addSound($target, new EndermanTeleportSound()); $owner->attack(new EntityDamageEvent($owner, EntityDamageEvent::CAUSE_FALL, 5)); } } }