Cooldown

class Cooldown(startingTime: Long, identifier: String)

This class is used to put cooldowns on certain actions, on certain in-game objects - e.g. clicking entities or blocks.

For example, this is used in Debug Entity Damage to stop spam from clicking the same entity over and over. It is also used in the Spawner Info for the same reason: blocks unnecessary chat spam.

Author

lokka30

Since

3.1.2

See also

#currentTimeMillis()

Constructors

Link copied to clipboard
constructor(startingTime: Long, identifier: String)

Functions

Link copied to clipboard

Checks if this cooldown belongs to something with a certain ID.

Link copied to clipboard
fun hasCooldownExpired(requiredTimeInSeconds: Long): Boolean

Check if the cooldown's required time (seconds!) has surpassed since the starting point.