PotionContentsHelper
com.jsmacrosce.jsmacros.client.api.helper.inventory.PotionContentsHelper
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
getColor(): int#Returns the item's potion color, including a custom color when set.
Returns: the potion color as an RGB integer
getEffects
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