Skip to content

@minecraft/server


@minecraft/server / Effect

Class: Effect ​

Defined in: @minecraft/server/index.d.ts:8101

Represents an effect - like poison - that has been added to an Entity.

Properties ​

amplifier ​

readonly amplifier: number

Defined in: @minecraft/server/index.d.ts:8111

Remarks ​

Gets an amplifier that may have been applied to this effect. Sample values range typically from 0 to 4. Example: The effect 'Jump Boost II' will have an amplifier value of 1.

Throws ​

This property can throw when used.


displayName ​

readonly displayName: string

Defined in: @minecraft/server/index.d.ts:8118

Remarks ​

Gets the player-friendly name of this effect.

Throws ​

This property can throw when used.


duration ​

readonly duration: number

Defined in: @minecraft/server/index.d.ts:8128

Remarks ​

Gets the entire specified duration, in ticks, of this effect. There are 20 ticks per second. Use TicksPerSecond constant to convert between ticks and seconds.

Throws ​

This property can throw when used.


isValid ​

readonly isValid: boolean

Defined in: @minecraft/server/index.d.ts:8135

Remarks ​

Returns whether an effect instance is available for use in this context.


typeId ​

readonly typeId: string

Defined in: @minecraft/server/index.d.ts:8142

Remarks ​

Gets the type id of this effect.

Throws ​

This property can throw when used.