menu
#4219477 str_repeat(): Second argument has to be greater than or equal to 0

Submitted by PocketMine-MP 3.12.2

General information

Version: 3.12.2
Git commit: 9b6b3f50
Plugin involvement: Direct
Report date: 2020-05-23 00:28:38 +0000 UTC

System Information

PHP version: 7.3.16
Operating system: linux
System banner: Linux dd329201-43fb-4577-96bc-525819cfc17b 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64

Error information

Warning: the HealthTag plugin was directly involved in this crash. Please contact the plugin author.
Message: str_repeat(): Second argument has to be greater than or equal to 0
File: plugins/HealthTag 2.phar/src/shelly7w7/HealthTag/TagTask
Line: #17
Error level: ErrorException
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

class TagTask extends Task{

public function onRun(int $tick) : void{
foreach(Main::getInstance()->getServer()->getOnlinePlayers() as $player) {
$player->setNameTagVisible(true);
if(Main::getInstance()->getConfig()->get("type") === "custom"){
$player->setScoreTag(str_replace(["{health}", "{maxhealth}"], [$player->getHealth(), $player->getMaxHealth()], Main::getInstance()->getConfig()->getNested("customformat")));
}else if(Main::getInstance()->getConfig()->get("type") === "bar"){
$player->setScoreTag(str_repeat("§a|", (int) round($player->getHealth(), 0)).str_repeat("§c|", (int) round($player->getMaxHealth() - $player->getHealth(), 0)));
}else{
$player->setScoreTag("Invalid type chosen for healthtag");
}
}
}
}
#0 (): pocketmine\utils\Utils::errorExceptionHandler(integer 2, string[66] str_repeat(): Second argument has to be greater than or equal to 0, string[83] phar:///home/container/plugins/HealthTag 2.phar/src/shelly7w7/HealthTag/TagTask., integer 17, array[2])
#1 plugins/HealthTag 2.phar/src/shelly7w7/HealthTag/TagTask(17): str_repeat(string[4] ..c|, integer -1024)
#2 src/pocketmine/scheduler/TaskHandler(134): shelly7w7\HealthTag\TagTask->onRun(integer 3797075)
#3 src/pocketmine/scheduler/TaskScheduler(176): pocketmine\scheduler\TaskHandler->run(integer 3797075)
#4 src/pocketmine/plugin/PluginManager(643): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 3797075)
#5 src/pocketmine/Server(2380): pocketmine\plugin\PluginManager->tickSchedulers(integer 3797075)
#6 src/pocketmine/Server(2143): pocketmine\Server->tick()
#7 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
#8 src/pocketmine/Server(1584): pocketmine\Server->start()
#9 src/pocketmine/PocketMine(272): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
#10 src/pocketmine/PocketMine(295): pocketmine\server()
#11 (11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show