类 Effect实验性

表示一个附加到实体上的效果,例如中毒。

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

属性

amplifier: number

获取应用于此效果的放大器值。 典型的取值范围通常是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.

This property can throw when used.

displayName: string

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

Gets the player-friendly name of this effect.

This property can throw when used.

duration: number

获取此效果的总持续时间(以刻为单位)。每秒有20个刻。使用 TicksPerSecond 常量在刻与秒之间转换。

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.

This property can throw when used.

isValid: boolean

返回此上下文中是否可用效果实例。

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

typeId: string

获取此效果的类型ID。

Gets the type id of this effect.

This property can throw when used.