Whenever I try to set down a skull, it always returns this error. Code: [01:43:15] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\player\PlayerDeathEvent' to 'ParadoxUHC v1.1.0': Call to a member function getName() on null on ParadoxUHC\UHC [01:43:15] [Server thread/CRITICAL]: Error: "Call to a member function getName() on null" (EXCEPTION) in "/src/pocketmine/nbt/tag/CompoundTag" at line 37 While I have already looked at CompoundTag, I still cannot figure out why. PHP: public function onDeath(Death $event){ $player = $event->getEntity(); if($this->config->get("pole") === "true"){ if($player instanceof Player) { if ($this->status === self::STATUS_PVP || $this->status === self::STATUS_TP_1 || $this->status === self::STATUS_TELE_1 || $this->status === self::STATUS_TP_2 || $this->status === self::STATUS_TELE_2 || $this->status === self::STATUS_LAST) { $x = $player->x; $y = $player->y; $z = $player->z; $level = $player->getLevel(); $level->setBlock(new Vector3($x, $y, $z), Block::get(Block::NETHER_BRICK_FENCE)); $nbt = new CompoundTag("", [ new StringTag("id", Tile::SKULL), $this->namedtag->SkullType, new IntTag("x", $x), new IntTag("y", $y), new IntTag("z", $z), $this->namedtag->Rot ]); $tile = Tile::createTile("Skull", $level->getChunk($x >> 4, $z >> 4), $nbt); $level->addTile($tile); $level->setBlock(new Vector3($x, $y+1, $z), Block::get(Block::SKULL_BLOCK)); } } } }
PHP: public function onDeath(Death $event){ $player = $event->getEntity(); if($this->config->get("pole") === "true"){ if($player instanceof Player) { if ($this->status === self::STATUS_PVP || $this->status === self::STATUS_TP_1 || $this->status === self::STATUS_TELE_1 || $this->status === self::STATUS_TP_2 || $this->status === self::STATUS_TELE_2 || $this->status === self::STATUS_LAST) { $x = $player->x; $y = $player->y; $z = $player->z; $item = new Item(Item::SKULL); $rot = new ByteTag("Rot", 0); $level = $player->getLevel(); $level->setBlock(new Vector3($x, $y, $z), Block::get(Block::NETHER_BRICK_FENCE)); $nbt = new CompoundTag("", [ new StringTag("id", Tile::SKULL), new IntTag("x", $x), new IntTag("y", $y+1), new IntTag("z", $z), new ByteTag("SkullType", $item->getDamage()), $rot ]);; $chunk = $player->getLevel()->getChunk($x >> 4, $z >> 4); $sk= Tile::createTile(Tile::SKULL, $chunk, $nbt); $level->addTile($sk); $skull = new SkullBlock(3); $player->getLevel()->setBlock(new Vector3($x, $y+1, $z), $skull, true, true); } } } }
Why does positions differ from PHP: new Vector3($x, $y, $z) with this one PHP: new IntTag("x", $x),new IntTag("y", $y+1),new IntTag("z", $z), Look at this SkullBlock.php