I have this error, idk how to fix it. please help This is the error in console: Code: [PocketMine] > "Could not pass event 'pocketmine\event\entity\EntityDamageByEntityEvent' to 'GameSelector v1': Argument 1 passed to pocketmine\tile\Chest::__construct() must be an instance of pocketmine\level\Level, instance of pocketmine\level\format\Chunk given, called in C:\Users\Admin\Creative Cloud Files\Desktop\PymePE\Lobby - PrymePE\plugins\GameSelector-master\src\GameSelector\Main.php on line 176 on GameSelector\Main [PocketMine] > TypeError: "Argument 1 passed to pocketmine\tile\Chest::__construct() must be an instance of pocketmine\level\Level, instance of pocketmine\level\format\Chunk given, called in C:\Users\Admin\Creative Cloud Files\Desktop\PymePE\Lobby - PrymePE\plugins\GameSelector-master\src\GameSelector\Main.php on line 176" (EXCEPTION) in "/src/pocketmine/tile/Chest" at line 44 Here is the plugin code line 166 - 189: PHP: public function OnDamage(EntityDamageEvent $event){ if($event instanceof EntityDamageByEntityEvent){ $player=$event->getDamager(); $entity=$event->getEntity(); if($player instanceof Player and $this->mode==1){ $event->setCancelled(true); $x=round($entity->getX()); $y=round($entity->getY() - 3); $z=round($entity->getZ()); $player->getLevel()->setBlock(new Vector3($x, $y, $z), Block::get(54)); $chest = new Chest($player->getLevel()->getChunk($x >> 4, $z >> 4, true), new CompoundTag(false, array(new IntTag("x", $x), new IntTag("y", $y), new IntTag("z", $z), new StringTag("id", Tile::CHEST)))); $chest->setName($this->name); $chest->saveNBT(); $player->getLevel()->addTile($chest); $chest2=new ChestInventory($player->getLevel()->getTile(new Vector3($x, $y, $z)), $player); $ch=$player->getLevel()->getTile(new Vector3($x, $y, $z)); $n=$this->name; $ch->saveNBT(); $level=$player->getLevel()->getFolderName(); $this->config->setNested("Selectors.$n", ["x"=>$x, "y"=>$y, "z"=>$z, "level"=>$level, "Items"=>new ListTag("Items",$ch->getInventory()), "SelectorName"=>$n, "FloatingText"=>false, "FloatingTextName"=>$n]); $this->config->setAll($this->config->getAll()); $this->config->save(); $player->sendMessage($this->prefix.c::GRAY."Entity Selected!"); $this->mode=0;
This one needs to be : PHP: $chest = new Chest($player->getLevel(), new CompoundTag(false, array(new IntTag("x", $x), new IntTag("y", $y), new IntTag("z", $z), new StringTag("id", Tile::CHEST))));