PHP: TypeError: "strtolower() expects parameter 1 to be string,integer given" (EXCEPTION) in "/src/pocketmine/Server" at line 1224[14:34:26] critical> TypeError: "strtolower() expects parameter 1 to be string,integer given" (EXCEPTION) in "/src/pocketmine/Server" at line 1224
This is the full code PHP: <?phpnamespace UHC\Commands;use UHC\Loader;use pocketmine\command\CommandSender;use pocketmine\Player;use pocketmine\Server;use pocketmine\utils\TextFormat as TF;use pocketmine\level\Position;use pocketmine\math\Vector3;use pocketmine\item\Item;use pocketmine\inventory\PlayerInventory;use pocketmine\entity\Effect;use pocketmine\network\mcpe\protocol\SetDifficultyPacket;class UHCCommand extends BaseCommand{ public function __construct(Loader $plugin) { $this->plugin = $plugin; parent::__construct($plugin, "uhc", "Main UHC command!", "/uhc [help|start]", []); $this->setPermission("uhc.op"); } public function execute(CommandSender $sender, $commandLabel, array $args) { if (!$this->testPermission($sender)) { return false; } if (count($args) < 1) { $sender->sendMessage(TF::RED . $this->usageMessage); return true; } if (isset($args[0])) { switch ($args[0]) { case "help": $sender->sendMessage("§7--- §aHosting Help §7---"); $sender->sendMessage("§7/uhc start"); $sender->sendMessage("§7/uhc restart"); $sender->sendMessage("§7/uhc reset"); $sender->sendMessage("§7/uhc tpall"); $sender->sendMessage("§7/uhc rtpall"); $sender->sendMessage("§7/uhc food"); $sender->sendMessage("§7/uhc healall"); $sender->sendMessage("§7/uhc ban"); break; } } if (isset($args[0])) { switch ($args[0]) { case "start": foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->addEffect(Effect::getEffect(Effect::NIGHT_VISION)->setAmplifier(1)->setDuration(1000000)); $p->addEffect(Effect::getEffect(Effect::FIRE_RESISTANCE)->setAmplifier(1)->setDuration(100000)); $p->getInventory()->clearAll(); $p->getInventory()->addItem(Item::get(Item::STONE_PICKAXE, 0, 1)); $p->getInventory()->addItem(Item::get(Item::STEAK, 0, 64)); $this->plugin->getServer()->setConfigInt("white-list", true); $this->plugin->getServer()->addWhitelist($p->getName()); $p->sendMessage("§e× §aGoodluck. The event started"); break; } } } if (isset($args[0])) { switch ($args[0]) { case "tpall": foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->teleport(new Vector3($sender->x, $sender->y, $sender->z, $sender->getLevel())); $p->sendMessage("§e× §9Teleporting..."); } } } if (isset($args[0])) { switch ($args[0]) { case "heal": foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->setHealth(20); $p->setFood(20); $p->sendMessage("§e× §aEveryone has been healed"); } } } if (isset($args[0])) { switch ($args[0]) { case "rtpall": foreach (Server::getInstance()->getOnlinePlayers() as $p) { $x = mt_rand(-90, 90); $y = mt_rand(70, 200); $z = mt_rand(-90, 90); $p->teleport(new Vector3($x, $y, $z)); $p->sendMessage("§e× §aRandomly spreading players around the map!"); } } } if (isset($args[0])) { switch ($args[0]) { case "clear": foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->getInventory()->clearAll(); $p->removeAllEffects(); $p->setHealth(20); $p->setFood(20); $p->sendMessage("§e× §3This round has been reset"); } } } if (isset($args[0])) { switch ($args[0]) { case "pvp": switch ($args[1]) { case "on": $this->plugin->getServer()->getConfigInt("difficulty", 3); $pk = new SetDifficultyPacket(); $pk->difficulty = $this->plugin->getServer()->getDifficulty(); foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->sendMessage("§e× §aPvP toggled on"); } } switch ($args[1]) { case "off": $this->plugin->getServer()->getConfigInt("difficulty", 0); $pk = new SetDifficultyPacket(); $pk->difficulty = $this->plugin->getServer()->getDifficulty(); foreach (Server::getInstance()->getOnlinePlayers() as $p) { $p->sendMessage("§e× §cPvP toggled off"); } } } } }}