My Plugin doesnt work. It will make that i can shot Snowballs on a rod. Here is the Error Code: [Server] [PocketMine] [12:36:31] CRITICAL> "Could not pass event 'pocketmine\event\player\PlayerInteractEvent' to 'SoupFFA v1.0.0': Class pocketmine\nbt\tag\EnumTag not found on Main\SoupFFA [Server] [PocketMine] [12:36:31] CRITICAL> ClassNotFoundException: "Class pocketmine\nbt\tag\EnumTag not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 144 Here is the PlayerInteractEvent in my Code: PHP: public function onInteract(PlayerInteractEvent $event){ if($event->getItem()->getId() == 346){ $namedTag = new CompoundTag("", [ "Pos" => new EnumTag("Pos", [ new DoubleTag("", $player->x), new DoubleTag("", $player->y + $player->getEyeHeight()), new DoubleTag("", $player->z) ]), "Motion" => new EnumTag("Motion", [ new DoubleTag("", -sin($player->yaw / 180 * M_PI) * cos($player->pitch / 180 * M_PI)), new DoubleTag("", -sin($player->pitch / 180 * M_PI)), new DoubleTag("", cos($player->yaw / 180 * M_PI) * cos($player->pitch / 180 * M_PI)) ]), "Rotation" => new EnumTag("Rotation", [ new FloatTag("", $player->yaw), new FloatTag("", $player->pitch) ]), ]); $ball = new SnowBall($player->chunk, $namedTag, $player); $ball->setMotion($event->getMotion()->multiply(3)); $ball->spawnToAll(); $player->getLevel()->addSound(new BlazeShootSound($player), [$player]); } } PS. I have importet pocketmine\nbt\tag\DoubleTag, pocketmine\nbt\tag\FloatTag, pocketmine\nbt\tag\CompoundTag and pocketmine\nbt\tag\EnumTag
blind guessing you should update your IDE seems like parts of networking namespace have changed not sure if NBT are changed doe
EnumTag is not a class there https://github.com/pmmp/PocketMine-MP/tree/master/src/pocketmine/nbt/tag The Enum class was replaced with the ListTag class https://github.com/pmmp/PocketMine-...0349#diff-e7946cb9b02a4dba1a3d5e627e31b2ccR97
Thanks Can you also help me with another error its the New error as i have EnumTag replace to ListTag. Here is the Error Code: [Server] [PocketMine] [13:41:06] CRITICAL> "Could not pass event 'pocketmine\event\player\PlayerInteractEvent' to 'SoupFFA v1.0.0': Argument 1 passed to pocketmine\entity\Snowball::__construct() must be an instance of pocketmine\level\Level, instance of pocketmine\level\format\Chunk given, called in /storage/emulated/0/PocketMine/plugins/SoupFFA_v2.0.0/src/Main/SoupFFA.php on line 192 on Main\SoupFFA [Server] [PocketMine] [13:41:06] CRITICAL> TypeError: "Argument 1 passed to pocketmine\entity\Snowball::__construct() must be an instance of pocketmine\level\Level, instance of pocketmine\level\format\Chunk given, called in /storage/emulated/0/PocketMine/plugins/SoupFFA_v2.0.0/src/Main/SoupFFA.php on line 192" (EXCEPTION) in "/src/pocketmine/entity/Snowball" at line 39
Yes i read this. I ve imported pocketmine\entity\Snowball, pocketmine\level\format\Chunk and pocketmine\level\Level.
simply importing is not the solution. The use statements aren't even needed! You have to pass the Level object instead of the Chunk object. It's exactly as the error states!
Best way to get help is to provide a "working" code with only the important parts. Never ever do anything like this: Code: $event->getItem()->getId() == 346 Editor: vim