ConsumeEffectHelper
com.jsmacrosce.jsmacros.client.api.helper.inventory.ConsumeEffectHelper
Describes an action configured to run when an item is consumed, such as applying status effects.
js
const use = Player.getPlayer()?.getMainHand().getComponents().getConsumable();
if (use != null) {
for (const effect of use.getEffects()) {
const chance = effect.getApplyProbability();
if (chance !== null) Chat.log(`${effect.getTypeId()}: ${Math.round(chance * 100)}% chance`);
}
}Methods
getAppliedEffects
getAppliedEffects(): List<StatusEffectHelper>#Returns: copies of the status effects to apply, or
null for other action types