Comment on page

StatusEffectAdded

Fires when a Status Effect is added to an Entity
Example usage:
Events.StatusEffectAdded(function(event)
if (event.statusEffect == StatusEffectType.NO_KNOCKBACK) then
local player = event.entity:getPlayer()
if (player == nil) then
return
end
-- Give the player a knockback baguette
InventoryService.giveItem(player, ItemType.BAGUETTE, 1, true)
end
end)

Parameters

entity: Entity

The entity that received the status effect.

statusEffect: StatusEffectType

The type of status effect that was added to the entity.