I recently making an UHC plugin and there's problem with it PHP: $nbt = new CompoundTag(" ", [ new ListTag("Items", []), new StringTag("id", Tile::SKULL), new IntTag("x", $x), new IntTag("y", $y), new IntTag("z", $z) ]); $level->setBlock($block, Block::get(113)); $head = Tile::createTile("Skull",$player->getLevel()->getChunk($block->getX() >> 4, $block->getZ() >> 4), $nbt); $level->addTile($head); $player is the player object, $x, $y, $z is the player's coordinate Console logs: Code: 24.09 06:45:18 [Server] Server thread/CRITICAL Error: "Call to a member function getName() on null" (EXCEPTION) in "/src/pocketmine/nbt/tag/CompoundTag" at line 37 24.09 06:45:18 [Server] Server thread/CRITICAL "Could not pass event 'pocketmine\event\player\PlayerDeathEvent' to 'FenceSkull v1.0.0': Call to a member function getName() on null on fenceskull\Main 24.09 06:45:18 [Server] INFO Notice: Undefined property: pocketmine\nbt\tag\CompoundTag::$Rot in phar:///home/multicraft/jar/pocketmine/genisys/0.15/Genisys.0.15.9.phar/src/pocketmine/tile/Skull.php on line 57
This is most likely because one of the value in the array, the second argument passed to CompoundTag constructor, is null This is because your compound tag is missing a "Rot" property, correct nbt should be PHP: $nbt = new CompoundTag("", [ new StringTag("id", Tile::SKULL), new IntTag("x", $block->x), new IntTag("y", $block->y), new IntTag("z", $block->z), new ByteTag("SkullType", 0), new ByteTag("Rot", 0) ]);
You need to create the tile and add it to the world. PHP: $tile = Tile::createTile("Skull", $player->getLevel()->getChunk($player->getX() >> 4, $player->getZ() >> 4), $nbt);$player->getLevel()->addTile($tile);
I did read that but after you code was corrected I assumed that you copied and pasted what @wolfdale said.