So I generated a void type of a world which means there are absolutely no other blocks in it but only air in the first place. I tried generating a structure at some coordinates using $level->setBlock($pos, $block) where $level is an instance of Level, $pos is an instance of Vector3 and $block is an instance of Block. This code does not give any errors but it is just not generating the block in the world. Help please
Are you sure you have put a block from 1 to 255? If yes, give us your code. This may help us to find out what is going wrong...
This is my code : PHP: for ($x = $coords['x'] - $size; $x <= $coords['x'] + $size; $x++) { for ($z = $coords['z'] - $size; $z <= $coords['z'] + $size; $z++) { $level->setBlock(new Vector3($x, $coords['y'], $z), Block::get(2)); for($y = $coords['y'] - 1; $y >= $coords['y'] - $size; $y--) { $level->setBlock(new Vector3($x, $y, $z), Block::get(3)); } } } There
That is not the issue I have. $coords['x'], $coords['y'] and $coords['z'] are all instance of int. The player is even being teleported later on to these coordinates without a problem. I assure you, the problem is not in the coordinates.
The code you showed has no obvious problems. The problem must be in your setup, such as wrong configuration, etc. Dump some debug info to make sure you set the block at your intended coordinates.
It says the block is being generated at the specified random coordinates, however when I go to these coordinates, there is nothing there except air
Okay this makes absolutely no sense. I did debug, everything is ok. $level->setBlock() just doesn't set the block. I didn't have such issues on a normal world Edit: (can someone move this outside of facepalm? I accidently placed it here lol)