I want to create a chest on Interact and replace the clicked Block with a chest and refill it with random Items , but it dont work PHP: public function onInteract(PlayerInteractEvent $event){ $block = $event->getBlock(); $blockID = $block->getID(); $player = $event->getPlayer(); if($blockID === 152){ $position = $player->getPosition(); $player->getLevel()->setBlock($block, Block::get(54, 0), true, true); $nbt = new Compound("", [ new Enum("Items", []), new String("id", Tile::CHEST), new Int("x", $position->getX()), new Int("y", $position->getY()), new Int("z", $position->getZ()) ]); $nbt->Items->setTagType(NBT::TAG_Compound); $tile = Tile::createTile("Chest", $player->getLevel()->getChunk($block->getX() >> 4, $block->getZ >> 4), $nbt); $chest = $player->getLevel()->getTile($block); for($i = 0; $i < 6; $i++){ $items = array( Item::get(Item::BREAD, 0, 6), Item::get(260, 0, 4), Item::get(261, 0, 1), Item::get(268, 0, 1), Item::get(306, 0, 1), Item::get(308, 0, 1), Item::get(301, 0, 1), Item::get(299, 0, 1), Item::get(267, 0, 1) ); $itemRnd = mt_rand(0, count($items) -1); $item = $items[$itemRnd]; $chest->getInventory()->addItem($item); } } } and here the Error , the error comes if i tap on a redstone bloc(ID 152) the chest will be created but is empty PHP: [Server] [17:20:56] [INFO]: Bluplayz[/127.0.0.1:19132] logged in with entity id 1 at (world, 126.0246, 73, 130.6556)[Server] [17:20:56] [INFO]: There are 1/20 players online:[Server] [17:20:56] [INFO]: Bluplayz[Server] [17:20:57] [INFO]: Bluplayz joined the game[Server] [17:21:00] [CRITICAL]: "Could not pass event 'pocketmine\event\player\PlayerInteractEvent' to 'JumpLeague v1': Argument 2 passed to pocketmine\tile\Tile::createTile() must implement interface pocketmine\level\format\FullChunk, null given, called in /storage/emulated/0/PocketMine/plugins/JumpLeague/src/Bluplayz/JumpLeague.php on line 54 and defined on Bluplayz\JumpLeague[Server] [17:21:00] [NOTICE]: RuntimeException: "Argument 2 passed to pocketmine\tile\Tile::createTile() must implement interface pocketmine\level\format\FullChunk, null given, called in /storage/emulated/0/PocketMine/plugins/JumpLeague/src/Bluplayz/JumpLeague.php on line 54 and defined" (E_RECOVERABLE_ERROR) in "/src/pocketmine/tile/Tile" at line 84