It's somthing like this use pocketmine\level\generator\object\Tree; Tree::growTree(ChunkManager $level, $x, $y, $z, $this->random, 0);
It looks like you just took that code snippet out of a plugin. Those parameters aren't really accurate. None of them need to be attributes of the class. The function is: PHP: Tree::growTree(ChunkManager $level, $x, $y, $z, Random $random, $type); $level does not necessarily need to be a Level. It can be an instance of ChunkManager instead. I wouldn't use chunkX and chunkZ values, because in my experience, it causes the tree to be generated weirdly. $x, $y, and $z are self explanatory. $random must be an instance of pocketmine\utils\Random, and $type is the type of tree that will be generated.
Here PHP: <?phpnamespace SkyBlock\generator\generators;use pocketmine\block\Block;use pocketmine\level\ChunkManager;use pocketmine\level\generator\normal\object\Tree;use pocketmine\math\Vector3;use pocketmine\utils\Random;use SkyBlock\generator\SkyBlockGenerator;class BasicIsland extends SkyBlockGenerator { /** @var array */ private $settings; /** @var string */ private $name; /** @var ChunkManager */ private $level; /** @var Random */ private $random; /** * BasicIsland constructor. * * @param array $settings */ public function __construct(array $settings = []) { $this->settings = $settings; } /** * Initialize BasicIsland * * @param ChunkManager $level * @param Random $random */ public function init(ChunkManager $level, Random $random) { $this->level = $level; $this->random = $random; $this->name = "basic"; $this->islandName = "Basic Island"; } /** * Return generator name * * @return string */ public function getName() { return $this->name; } public function getSettings() { return $this->settings; } public function generateChunk($chunkX, $chunkZ) { $chunk = $this->level->getChunk($chunkX, $chunkZ); $chunk->setGenerated(); if ($chunkX % 20 == 0 && $chunkZ % 20 == 0) { for ($x = 0; $x < 16; $x++) { for ($z = 0; $z < 16; $z++) { $chunk->setBlock($x, 0, $z, Block::BEDROCK); for ($y = 1; $y <= 3; $y++) { $chunk->setBlock($x, $y, $z, Block::STONE); } $chunk->setBlock($x, 4, $z, Block::DIRT); $chunk->setBlock($x, 5, $z, Block::GRASS); } Tree::growTree($this->level, $chunkX * 16 + 8, 6, $chunkZ * 16 + 8, $this->random, 0); } $chunk->setX($chunkX); $chunk->setZ($chunkZ); $this->level->setChunk($chunkX, $chunkZ, $chunk); } } public function populateChunk($chunkX, $chunkZ) { //TODO: Set Biome ID? return; } /** * Return BasicIsland spawn * * @return Vector3 */ public function getSpawn() { return new Vector3(8, 7, 10); }}