Here is the error: Fatal error: Method pocketmine\Player::__toString() must not throw an exception, caught TypeError: Return value of pocketmine\entity\Entity::getId() must be of the type int, null returned in phar:///home/linux/pmmp/plugins/cucumber.phar/src/adeynes/cucumber/CucumberListener.php on line 0 Here is some relevant information I find near line 0: <?php declare(strict_types=1); namespace adeynes\cucumber; use adeynes\cucumber\command\VanishCommand; use adeynes\cucumber\event\CucumberEvent; use adeynes\cucumber\event\ChatAttemptEvent; use adeynes\cucumber\event\ChatEvent; use adeynes\cucumber\event\CommandEvent; use adeynes\cucumber\event\JoinAttemptEvent; use adeynes\cucumber\event\JoinEvent; use adeynes\cucumber\event\QuitEvent; use adeynes\cucumber\utils\MessageFactory; use adeynes\cucumber\utils\Queries; use pocketmine\event\Event; use pocketmine\event\Listener; use pocketmine\event\player\PlayerChatEvent; use pocketmine\event\player\PlayerCommandPreprocessEvent; use pocketmine\event\player\PlayerJoinEvent; use pocketmine\event\player\PlayerPreLoginEvent; use pocketmine\event\player\PlayerQuitEvent; use pocketmine\Server; use pocketmine\utils\TextFormat; use pocketmine\plugin\Plugin; and the best part is that whenever I place this line, it happens otherwise, server doesn't crash. $this->plugin->getLogger()->info(TextFormat::BLUE."Blacklist Check: Checking $player's IP [$ip] for a record in rbl.hyphovy.net"); ^^ Some more relevant information: public function __construct(Cucumber $plugin) { $this->plugin = $plugin; $config = $this->getPlugin()->getConfig(); $this->log_traffic = $config->getNested('log.traffic'); $this->log_chat = $config->getNested('log.chat'); $this->log_command = $config->getNested('log.command'); } public function getPlugin(): Cucumber { return $this->plugin; } I don't know if there is a syntax error, but the error doesn't explain much to me. Please help me solve it.
I Found: PHP: $this->plugin->getLogger()->info(TextFormat::BLUE."Blacklist Check: Checking $player's IP [$ip] for a record in rbl.hyphovy.net"); You Forgot getServer() : PHP: $this->getServer()->getLogger()->info(TextFormat::BLUE."Blacklist Check: Checking $player's IP [$ip] for a record in rbl.hyphovy.net");
Are you stupid or something? getServer() will return null because the function does not exist in the class. Also the thing you're trying to do would not fix the bug. Don't give fake information without knowing it's going to work.
Short Story: Yes im Stupid Long Story: I Know like 20% of PHP, I'm Not That Good in PHP, i'm Good in C++, i Say We Should Return To Original Thread Topic. Thanks
USE [./PHP] tags. Is this PHP: $this->plugin->getLogger()->info(TextFormat::BLUE."Blacklist Check: Checking $player's IP [$ip] for a record in rbl.hyphovy.net"); in cucumber.php or the plugin file? which one is the main file? If ^^^ is in main class file, if it is in main class file, use getServer() instead of plugin.