menu
#7556660 Declaration of pixelguy75\joincommands\Main::onEnable() must be compatible with pocketmine\plugin\PluginBase::onEnable(): void

Submitted by PocketMine-MP 4.9.0

General information

Version: 4.9.0
Git commit: 785dc712
Plugin involvement: Direct
Report date: 2022-09-22 21:18:57 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 0 seconds

System Information

PHP version: 8.0.22
JIT status: Disabled
Operating system: win
System banner: Windows NT PC-HACKING 10.0 build 19044 (Windows 10) AMD64

Error information

Warning: a plugin was directly involved in this crash. Please contact the plugin author.
Message: Declaration of pixelguy75\joincommands\Main::onEnable() must be compatible with pocketmine\plugin\PluginBase::onEnable(): void
File: plugins/JoinCommands.phar/src/pixelguy75/joincommands/Main
Line: #16
Error level: E_COMPILE_ERROR
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use pocketmine\event\player\PlayerDeathEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\player\PlayerRespawnEvent;
use pocketmine\event\Listener;
use pocketmine\plugin\PluginBase;
use pocketmine\Player;

class Main extends PluginBase implements Listener{
public function onEnable(){
$this->getServer()->getPluginManager()->registerEvents($this, $this);
$this->saveDefaultConfig();
}
public function onPreLogin(PlayerPreLoginEvent $event){
if($this->getConfig()->get("enablejoin") === true){
$player = $event->getPlayer();
foreach($this->getConfig()->get("JoinCommand") as $command){
$this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $command));
}
}

Loaded Plugins

  • Show

Server Settings

  • Show

Installed PHP Extensions

  • Show