I have this: PHP: public function onInteract(PlayerInteractEvent $event) { $player = $event->getPlayer(); if($player->isOp()){ $block = $event->getBlock(); $level = $player->getLevel(); $X = $block->getX(); $Y = $block->getY(); $Z = $block->getZ();// I want to get all the blocks connected to this block and then all the block conntected to those blocks and so on. Or if this can't be done how do I get the blocks in an area? heeellppp!// also must get what block it is.. foreach($blocks as $b) $X = $b->getX(); $Y = $b->getY(); $Z = $b->getZ(); $pos = new Vector3($X-1, $Y, $Z); $level->setBlock($pos, $b, false, false); } } The code says it all. so how can I do this? essentially what I'm trying to achieve is to move a floating ship 1 block ahead of itself when I tap any block on the ship.
Don't think its possible to connect blocks to each other in that manner, sorta like slime blocks in a sense. I'm guessing instead you would need to move a block ID so make whatever your moving a specific block... such as dirt or something hope this helped in some way!
So if you click a block on the ground in a normal survival world, would this delete the whole world? Not sure about your exact scenario. How big do you expect your chunks of blocks to be? You may want to use an iterator rather than an array if it gets too large to prevent memory exhaustion. Also beware recursion stack overflow.