Server thread/CRITICAL Error: "Cannot call constructor" (EXCEPTION) in "plugins/DropParty/src/dropparty/task/DropPartyTask" at line 14 Uhh how do I make the "CODE:" and "PHP:"?
<?php namespace dropparty\task; use pocketmine\scheduler\Task; use dropparty\DropParty; use pocketmine\item\Item; use pocketmine\utils\Config; use pocketmine\math\Vector3; class DropPartyTask extends Task { public function __construct(DropParty $plugin) { parent::__construct($plugin); $this->$this->getPlugin(); } public function getPlugin() { return $this->plugin; } public function onRun(int $currentTick) { $msg = str_replace("{time}", $this->getPlugin()->time, $this->getPlugin()->config()["Message.Countdown"]); if($this->getPlugin()->time > 0) { $this->getPlugin()->getServer()->broadcastMessage($msg); } if($this->getPlugin()->time == 0) { $this->getPlugin()->getServer()->broadcastMessage($this->getPlugin()->config()["Message.Started"]); $this->getPlugin()->status = "enabled"; } $this->getPlugin()->time = $this->getPlugin()->time - 1; } }
Hey! I’m not sure about line 14, but why did you write the pseudo variable twice? $this->$this->getPlugin(); As far as I’m aware things don’t work like that. Change the variable name, and change the first object operator to an equals sign.