Skip to content

Mob Effect ​

The MobEffect is a utility binding that gives access to all vanilla effects. It can be used to define effects for Coffee Ingredient recipes, either directly or through the EffectInstance binding.

The constants use the field names of the Minecraft code, which differ from the effect IDs for some effects. For effects added by other mods, use the effect ID instead.

Overview ​

  • access in server scripts via: MobEffect
  • values:
ConstantEffect ID
MobEffect.MOVEMENT_SPEEDminecraft:speed
MobEffect.MOVEMENT_SLOWDOWNminecraft:slowness
MobEffect.DIG_SPEEDminecraft:haste
MobEffect.DIG_SLOWDOWNminecraft:mining_fatigue
MobEffect.DAMAGE_BOOSTminecraft:strength
MobEffect.HEALminecraft:instant_health
MobEffect.HARMminecraft:instant_damage
MobEffect.JUMPminecraft:jump_boost
MobEffect.CONFUSIONminecraft:nausea
MobEffect.REGENERATIONminecraft:regeneration
MobEffect.DAMAGE_RESISTANCEminecraft:resistance
MobEffect.FIRE_RESISTANCEminecraft:fire_resistance
MobEffect.WATER_BREATHINGminecraft:water_breathing
MobEffect.INVISIBILITYminecraft:invisibility
MobEffect.BLINDNESSminecraft:blindness
MobEffect.NIGHT_VISIONminecraft:night_vision
MobEffect.HUNGERminecraft:hunger
MobEffect.WEAKNESSminecraft:weakness
MobEffect.POISONminecraft:poison
MobEffect.WITHERminecraft:wither
MobEffect.HEALTH_BOOSTminecraft:health_boost
MobEffect.ABSORPTIONminecraft:absorption
MobEffect.SATURATIONminecraft:saturation
MobEffect.GLOWINGminecraft:glowing
MobEffect.LEVITATIONminecraft:levitation
MobEffect.LUCKminecraft:luck
MobEffect.UNLUCKminecraft:unluck
MobEffect.SLOW_FALLINGminecraft:slow_falling
MobEffect.CONDUIT_POWERminecraft:conduit_power
MobEffect.DOLPHINS_GRACEminecraft:dolphins_grace
MobEffect.BAD_OMENminecraft:bad_omen
MobEffect.HERO_OF_THE_VILLAGEminecraft:hero_of_the_village
MobEffect.DARKNESSminecraft:darkness
MobEffect.TRIAL_OMENminecraft:trial_omen
MobEffect.RAID_OMENminecraft:raid_omen
MobEffect.WIND_CHARGEDminecraft:wind_charged
MobEffect.WEAVINGminecraft:weaving
MobEffect.OOZINGminecraft:oozing
MobEffect.INFESTEDminecraft:infested

Examples ​

This binding is intended to be used inside Coffee Ingredient recipes. Pass it to the effects parameter directly to use the default duration of 10 seconds and amplifier of 0, or pass it to the EffectInstance binding to configure the effect.

js
ServerEvents.recipes(event => {
    // adds a coffee ingredient that gives Haste I and Regeneration I for 10 seconds for a potato
    event.recipes.actuallyadditions.coffee_ingredient("potato", [
        MobEffect.DIG_SPEED,
        MobEffect.REGENERATION,
    ])

    // adds a coffee ingredient that gives Night Vision I for 120 seconds for a golden carrot
    event.recipes.actuallyadditions.coffee_ingredient("golden_carrot", [
        EffectInstance.ofEffect(MobEffect.NIGHT_VISION, 120),
    ])
})