And then what? He wants a command that is only executable (for example 1 time per secound) How to do this? Here: Save time() in a array (with playername->time) and then check if 1 or 5 secounds are between them
PHP: $this->array = array();public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ if(strtolower($cmd->getName()) === "command") { $name = $sender->getName(); if(isset($this->array[$name])) { $last_usage_time = $this->array[$name]; if((time() - $last_usage_time) <= 5) // if the last time the user executed the command is less-than or equal to 5 seconds { $sender->sendMessage("Please wait " . (time() - $last_usage_time) . " more second(s) to use this command."); // Send the user how many more seconds he / she has to wait to use the command again. return true; } } else { $this->array[$name] = time(); // Do more stuff } }} Although there probably is a better way, I'm pretty sure this will work(haven't tested).
I think he want's a cooldown ex) You can only use this command every X seconds/min/hour/day/week/year/decade/etc.