Hi, so I was updating CombatLogger of 3.0.0-ALPHA12 to 3.0.01 and I found that issue, getOwner() seem to be a undefined method, here is the code of the Task PHP: use pocketmine\Player;use pocketmine\scheduler\Task;class TaggedHeartbeatTask extends Task { public function getPlugin() { return $this->getOwner(); } public function onRun(int $currentTick) { $plugin = $this->getPlugin(); foreach($plugin->taggedPlayers as $name => $time) { $time--; if($time <= 0) { $plugin->setTagged($name, false); $player = $plugin->getServer()->getPlayerExact($name); if($player instanceof Player) $player->sendMessage($plugin->getMessageManager()->getMessage("player-tagged-timeout")); return; } $plugin->taggedPlayers[$name]--; } }} I never really used getOwner and I tried to find it on pmmp but never found it..If someone can help.
When you hit someone, it will cancel the blocked commands in settings and send the message that you can't use commands while you are in combat but the plugin doesn't return, so the player stay in combat mode forever
It doesn't hurt. getOwner() was part of PluginTask, which was removed in the scheduler nuke pr. If you wish to use your plugin instance pass it over to the constructor. Here's an example: https://github.com/SalmonDE/TopVote...DE/TopVoter/Tasks/UpdateVotesTask.php#L15-L16
PHP: public function __construct(ClassYouSchedule $plugin){ $this->plugin = $plugin; } public function getOwner() : ClassYouSchedule{ return $this->plugin; }
It's working with that too : PHP: class TaggedHeartbeatTask extends Task { private $plugin; public function __construct(CombatLogger $plugin) { $this->plugin = $plugin; return; } public function onRun(int $currentTick) { foreach($this->plugin->taggedPlayers as $name => $time) { $time--; if($time <= 0) { $this->plugin->setTagged($name, false); $player = $this->plugin->getServer()->getPlayerExact($name); if($player instanceof Player) $player->sendMessage($this->plugin->getMessageManager()->getMessage("player-tagged-timeout")); return; } $this->plugin->taggedPlayers[$name]--; } }}