Hello! How i can make when i type command like: /test on , the task be enable, and when i type: /test off , the task be disable? i hope you understand me
PHP: class MyTask extends PluginTask{ public $disable = true; // your constructor code public function onRun(int $tick){ if($this->disable) return; // your normal code }} Store your task instance in a class property. When /test on, just set $this->task->disable = false, etc.
i tried this but it is not working i do not know why but i think i does not understand you exactly, can you explain please or give me an example?