# UseCooldownHelper

`com.jsmacrosce.jsmacros.client.api.helper.inventory.UseCooldownHelper`

**Since:** 2.3.0

Reads the cooldown configured on a stack and the custom group of items that share it.  
 ```js
const stack = Player.getPlayer()?.getMainHand();  
if (stack != null) {
  const cooldown = stack.getComponents().getUseCooldown();  
  if (cooldown !== null) Chat.log(`${cooldown.getGroupId() ?? stack.getItemId()}: ${cooldown.getDurationTicks()} ticks`);  
}
 ```

## Methods

### getDurationSeconds {#com.jsmacrosce.jsmacros.client.api.helper.inventory.UseCooldownHelper_getDurationSeconds-}

```js
getDurationSeconds(): float
```

**Returns:** the configured cooldown duration in seconds

### getDurationTicks {#com.jsmacrosce.jsmacros.client.api.helper.inventory.UseCooldownHelper_getDurationTicks-}

```js
getDurationTicks(): int
```

**Returns:** the configured duration after Minecraft converts it to ticks

### getGroupId {#com.jsmacrosce.jsmacros.client.api.helper.inventory.UseCooldownHelper_getGroupId-}

```js
getGroupId(): String
```

**Returns:** the configured group ID, or `null` if Minecraft uses the item's ID
