30.03 00:55:16 [Server] Server thread/CRITICAL ArgumentCountError: "Too few arguments to function CE\Enchant\sections\FlashLightHandler::__construct(), 0 passed in phar:///plugins/CE (53).phar/src/CE/Enchant/Main.php on line 296 and exactly 1 expected" (EXCEPTION) in "plugins/CE (53).phar/src/CE/Enchant/sections/FlashLightHandler" at line 32 FlashLightHandler.php PHP: public function __construct(Main $plugin) { //line 32 $this->plugin = $plugin; } public function onRun(int $currentTick) { foreach ($this->plugin->getServer()->getOnlinePlayers() as $player) { $enchantment = $player->getArmorInventory()->getBoots()->getEnchantment(CustomIDs::FLASHLIGHT); if ($enchantment !== null) { $player->addEffect(new EffectInstance(Effect::getEffect(Effect::POISON), $duration = 100, $amplifier = 0, $visible = true, $ambient = false)); } } }} Main.php PHP: public function registerHandlers(): void{ foreach($this->enchants as $enchant){ $this->getServer()->getPluginManager()->registerEvents(new $class(), $this); //line 296
PHP: public function registerHandlers(): void{ foreach($this->enchants as $enchant){ $this->getServer()->getPluginManager()->registerEvents(new $class($this), $this); }} I don't know where $class is defined