can someone help me finish this, I simply just want to make a cooldown when someone uses an item. This is the farthest I got. I tried and yes there is other threads. I find them too hard and more advanced whn I simply want to create a simple cooldown. PHP: case Item::FEATHER: $player->addEffect(Effect::getEffect(Effect::JUMP)->setAmplifier(1)->setDuration(20 * 8)); $this->addToCoolDown($name); break; } } public function addToCoolDown(Player $player, Item $item) { }
you need to do $this->addToCooldown($player,$item) not $name, as the hintypes you need 2 methods btw, one add one check the add method will set an array $this->$cooldowns[$name] = time()+"insert cooldown time", the check method will see if time() is > cooldown time