Do you mean the outer part of a square? The walls of a square? If you want to create a aquare use this: PHP: public function squareParticles(){ $startX = 130;//STARTING POINT X $endX = 140;//END POINT X $startY = 4;//STARTING POINT Y $endY = 14;//END POINT Y $startZ = 130;//STARTING POINT Z $endZ = 140;//END POINT Z for($x = $startX; $x <= $endX; ++$x){ for($y = $startY; $y <= $endY; ++$y){ for($z = $startZ; $z <= $endZ; ++$z){ $level = $this->getServer()->getLevelByName("world"); $level->addParticle(new DustParticle(new Vector3($x, $y, $z), 0, 0, 0)); } } } }

PHP: public function squareParticles(){ $startX = 130;//STARTING POINT X $endX = 140;//END POINT X $startY = 4;//STARTING POINT Y $endY = 14;//END POINT Y $startZ = 130;//STARTING POINT Z $endZ = 140;//END POINT Z for($x = $startX; $x <= $endX; ++$x){ for($y = $startY; $y <= $endY; ++$y){ for($z = $startZ; $z <= $endZ; ++$z){ if( $x == $startX || $x == $endX || $y == $startY || $y == $endY || $z == $startZ || $z == $endZ ) { $level = $this->getServer()->getLevelByName("world"); $level->addParticle(new DustParticle(new Vector3($x, $y, $z), 0, 0, 0)); } } } } }

This is too slow. (And this is a cuboid, not a square, but never mind) PHP: for($x = $startX; $x <= $endX; $x++){ addParticle($x, $y, $startZ); addParticle($x, $y, $endZ);}for($z = $startZ + 1; $z < $endZ; $z++){ addParticle($startX, $y, $z); addParticle($endX, $y, $z);}

I am not sure about that, but I'm quite sure that the difference is very negligible. Both exist in low-level instructions, so there shouldn't really be any difference.