getTypeId() === BlockTypeIds::OBSIDIAN || $blockClicked->getTypeId() === BlockTypeIds::BEDROCK){ $pos = $blockClicked->getPosition(); $world = $pos->getWorld(); $bb = AxisAlignedBB::one() ->offset($pos->getX(), $pos->getY(), $pos->getZ()) ->extend(Facing::UP, 1); if( count($world->getNearbyEntities($bb)) === 0 && $blockClicked->getSide(Facing::UP)->getTypeId() === BlockTypeIds::AIR && $blockClicked->getSide(Facing::UP, 2)->getTypeId() === BlockTypeIds::AIR ){ $crystal = new EntityEndCrystal(Location::fromObject($pos->add(0.5, 1, 0.5), $world)); $crystal->spawnToAll(); $this->pop(); return ItemUseResult::SUCCESS; } } return ItemUseResult::NONE; } }