menu
#3547707 Argument 1 passed to Bot\Main::spawnNPC() must be an instance of pocketmine\Player, instance of pocketmine\command\ConsoleCommandSender given

Submitted by PocketMine-MP 3.11.3

General information

Version: 3.11.3
Git commit: 0d5704b1
Plugin involvement: Direct
Report date: 2020-01-13 20:20:24 +0000 UTC

System Information

PHP version: 7.3.13
Operating system: win
System banner: Windows NT CLIENTE-PC 10.0 build 18362 (Windows 10) AMD64

Error information

Warning: the Bot plugin was directly involved in this crash. Please contact the plugin author.
Message: Argument 1 passed to Bot\Main::spawnNPC() must be an instance of pocketmine\Player, instance of pocketmine\command\ConsoleCommandSender given
File: plugins/Bot.phar/src/Bot/Main
Line: #47
Error level: TypeError
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
		$this->spawnNPC($sender, $args[0]);
$sender->sendMessage(TextFormat::GREEN . "Spawned Bot: " . $args[0]);
return true;
}

public function getCfg(): Config{
return new Config($this->getDataFolder() . "config.yml", Config::YAML);
}

public function spawnNPC(Player $player, string $name): void{
$nbt = Entity::createBaseNBT($player, null, 2, 2);
$nbt->setTag($player->namedtag->getTag("Skin"));
$npc = new NPCHuman($player->getLevel(), $nbt);
$npc->setNameTag($name);
$npc->setNameTagAlwaysVisible(true);
$npc->spawnToAll();
}
}
#0 plugins/Bot.phar/src/Bot/Main(38): Bot\Main->spawnNPC(object pocketmine\command\ConsoleCommandSender, string[2] df)
#1 src/pocketmine/command/PluginCommand(58): Bot\Main->onCommand(object pocketmine\command\ConsoleCommandSender, object pocketmine\command\PluginCommand, string[3] bot, array[1])
#2 src/pocketmine/command/SimpleCommandMap(270): pocketmine\command\PluginCommand->execute(object pocketmine\command\ConsoleCommandSender, string[3] bot, array[1])
#3 src/pocketmine/Server(2026): pocketmine\command\SimpleCommandMap->dispatch(object pocketmine\command\ConsoleCommandSender, string[6] bot df)
#4 src/pocketmine/Server(1617): pocketmine\Server->dispatchCommand(object pocketmine\command\ConsoleCommandSender, string[6] bot df)
#5 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\Server->pocketmine\{closure}()
#6 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
#7 src/pocketmine/Server(2349): pocketmine\snooze\SleeperHandler->sleepUntil(double 1578946824.2941)
#8 src/pocketmine/Server(2203): pocketmine\Server->tickProcessor()
#9 src/pocketmine/Server(1785): pocketmine\Server->start()
#10 src/pocketmine/PocketMine(268): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[28] C:\Users\Ruan\Desktop\PHP 2\, string[36] C:\Users\Ruan\Desktop\PHP 2\plugins\)
#11 src/pocketmine/PocketMine(291): pocketmine\server()
#12 (1): require(string[83] phar://C:/Users/Ruan/Desktop/PHP 2/PocketMine-MP.phar/src/pocketmine/PocketMine.)

Loaded Plugins

  • Show

Server Settings

  • Show