public function onCommand(CommandSender $sender, Command $command, $label, array $args) { if ($sender instanceof Player) { $name = $sender->getName(); if (strtolower($command->getName()) == "afk") { if (count($args) < 1) { $Phealth = getHealth(); $sender->sendMessage(Color::GREEN . "[AFK plugin] You are now AFK!"); $sender->setHealth(20); $sender->getEffect(10); $this->god = true; return; } else { $sender->sendMessage(Color::GREEN . "[AFK plugin] This command has no arguments!"); return; } } } else { $sender->sendMessage(Color::RED . "That command can only be run in console!"); return; } }