Function addEffect

  • Wrapper function for adding effect(s) or effect group.

    Parameters

    • entity: Entity

      The entity to add effect.

    • effectType:
          | string
          | string[]
          | EffectType
          | EffectType[]
          | EffectGroups

      the effect(s) to add, use EffectGroups to add group effects.

    • duration: number

      Amount of time, in ticks, for the effect to apply. There are 20 ticks per second. Use TicksPerSecond constant to convert between ticks and seconds. The value must be within he range [0, 20000000].

    • Optionaloptions: EntityEffectOptions

      Additional options for the effect.

    Returns void

    This function can throw errors.