# PotionContentsHelper

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

**Since:** 2.3.0

Reads the base potion, effects, and color stored on a potion or tipped arrow stack.  
 ```js
const contents = Player.getPlayer()?.getMainHand().getComponents().getPotionContents();  
if (contents != null) {
  for (const effect of contents.getEffects()) Chat.log(effect.getId());  
}
 ```

## Methods

### getColor {#com.jsmacrosce.jsmacros.client.api.helper.inventory.PotionContentsHelper_getColor-}

```js
getColor(): int
```

Returns the item's potion color, including a custom color when set.

**Returns:** the potion color as an RGB integer

### getEffects {#com.jsmacrosce.jsmacros.client.api.helper.inventory.PotionContentsHelper_getEffects-}

```js
getEffects(): List<StatusEffectHelper>
```

Returns copies of the base potion's effects followed by any custom effects. Durations are the
 values stored in the component, before any scaling from how the item is used.

**Returns:** the stored effects

### getPotionId {#com.jsmacrosce.jsmacros.client.api.helper.inventory.PotionContentsHelper_getPotionId-}

```js
getPotionId(): String
```

Returns the base potion's ID. Custom effects can exist without a base potion.

**Returns:** the potion ID, `"[unregistered]"` for an inline value, or `null` if absent
