withCooldown
inline fun <R> withCooldown(entity: Entity, delay: Long = defaultLength, block: () -> R): R?(source)
Executes the given block if the entity currently does not have this cooldown. If the block is executed, this function will call applyCooldown. After the given delay, the cooldown will be removed automatically.