For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Effect.md.

Class: Effect

effect

Beta

表示一个已添加到实体上的效果——例如中毒。

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

Properties

amplifier

readonly amplifier: number

Beta

Remarks

获取应用于此效果的放大器。示例值通常范围为 0 到 4。例如:效果"跳跃提升 II"的放大器值为 1。

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

Beta

Remarks

获取此效果的玩家友好名称。

Gets the player-friendly name of this effect.

Throws

This property can throw when used.


duration

readonly duration: number

Beta

Remarks

获取此效果的整个指定持续时间(以 tick 为单位)。每秒有 20 tick。使用 TicksPerSecond 常量在 tick 和秒之间进行转换。

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

Beta

Remarks

返回一个效果实例在此上下文中是否可用于使用。

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


typeId

readonly typeId: string

Beta

Remarks

获取此效果的类型 ID。

Gets the type id of this effect.

Throws

This property can throw when used.

同领域相关