[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / entity/StatusEffectTick

# entity/StatusEffectTick

## Interfaces

### StatusEffectHolder

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:72](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L72)

What [tickStatusEffects](#tickstatuseffects) reads and writes of the holder of a set of effects.

#### Properties

##### age

> `readonly` **age**: `number`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:76](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L76)

How many ticks the holder's effects have been ticked, the clock of an endless effect.

##### effects

> `readonly` **effects**: `Map`\<`string`, [`StatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffect)\>

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:74](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L74)

The holder's active effects by id, which the tick counts down in place.

#### Methods

##### apply()

> **apply**(`effect`, `clock`): `void`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:78](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L78)

What one effect does on the holder this tick, such as Poison's damage.

###### Parameters

###### effect

[`StatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffect)

###### clock

`number`

###### Returns

`void`

##### remove()

> **remove**(`id`): `void`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:80](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L80)

Takes one spent effect off the holder and tells clients.

###### Parameters

###### id

`string`

###### Returns

`void`

## Type Aliases

### EffectHealthChange

> **EffectHealthChange** = \{ `amount`: `number`; `kind`: `"heal"`; \} \| \{ `amount`: `number`; `cause`: [`DamageCause`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/DamageCause/index.md#damagecause-1); `kind`: `"damage"`; \}

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:5](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L5)

What one effect does to its holder's health on a tick it applies.

## Functions

### effectHealthChange()

> **effectHealthChange**(`id`, `amplifier`, `clock`, `health`, `maxHealth`): [`EffectHealthChange`](#effecthealthchange) \| `undefined`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:42](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L42)

What an effect does to health on one tick, from the 26.3 server's `MobEffect.applyEffectTick`.

Healing and harm are in half-hearts. Poison stops at one half-heart and wither does not, and
Bedrock's fatal poison is poison without the stop. Potency scales the instant effects by a
left shift, so level two heals eight and level six heals 128.

#### Parameters

##### id

`string`

The namespaced effect id.

##### amplifier

`number`

One below the displayed level.

##### clock

`number`

What the repeat interval counts: the ticks the effect has left, or the holder's
age for one that never expires.

##### health

`number`

The holder's health now.

##### maxHealth

`number`

The holder's maximum health.

#### Returns

[`EffectHealthChange`](#effecthealthchange) \| `undefined`

The change to apply this tick, or undefined when the effect does nothing to health now.

***

### isInstantEffect()

> **isInstantEffect**(`id`): `boolean`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L17)

Whether an effect applies once and is then spent, Java's `InstantenousMobEffect`.

#### Parameters

##### id

`string`

#### Returns

`boolean`

***

### tickStatusEffects()

> **tickStatusEffects**(`holder`): `void`

Defined in: [packages/prismarine/src/entity/StatusEffectTick.ts:92](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/StatusEffectTick.ts#L92)

Applies the effects that act on the server, then counts finite ones down and takes off the
ones that ran out.

Speed, jump boost, night vision and the like are the client's to apply once it has been told
of the effect; what lands here is what changes health, food and the damage taken. An instant
effect acts on the first tick and is spent, and an effect with a duration of one tick still
acts before it expires.

#### Parameters

##### holder

[`StatusEffectHolder`](#statuseffectholder)

#### Returns

`void`
