The EffectAddAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { EffectAddAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.effectAdd.
Example
Section titled “Example”import { world, type EffectAddAfterEvent } from '@minecraft/server';
world.afterEvents.effectAdd.subscribe((event: EffectAddAfterEvent) => { console.log('effectAdd', event.entity.typeId, event.effect.typeId);});import { world } from '@minecraft/server';
world.afterEvents.effectAdd.subscribe((event) => { console.log('effectAdd', event.entity.typeId, event.effect.typeId);});Properties
Section titled “Properties”entity
Section titled “entity”read-only
readonly entity: Entity;Types
effect
Section titled “effect”read-only
readonly effect: Effect;Types
Used by
Section titled “Used by”WorldAfterEvents.effectAdd, EffectAddAfterEventSignal.subscribe, EffectAddAfterEventSignal.unsubscribe