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/EntityBreathableComponent.md.

Class: EntityBreathableComponent

entity component

Beta

定义此实体可以在哪些方块中呼吸,并赋予它们窒息的能力。

Defines what blocks this entity can breathe in and gives them the ability to suffocate.

Extends

Properties

airSupply

实验性

airSupply: number

Beta World Mutation

Remarks

实体的当前空气供应量。

The current air supply of the entity.

Throws

如果空气供应超出范围 [suffocationTime, maxAirSupply] 将抛出错误。

Will throw an error if the air supply is out of bounds [suffocationTime, maxAirSupply].


breathesAir

readonly breathesAir: boolean

Beta

Remarks

如果为 true,此实体可以在空气中呼吸。

If true, this entity can breathe in air.

Throws

This property can throw when used.


breathesLava

readonly breathesLava: boolean

Beta

Remarks

如果为 true,此实体可以在熔岩中呼吸。

If true, this entity can breathe in lava.

Throws

This property can throw when used.


breathesSolids

readonly breathesSolids: boolean

Beta

Remarks

如果为 true,此实体可以在实心方块中呼吸。

If true, this entity can breathe in solid blocks.

Throws

This property can throw when used.


breathesWater

readonly breathesWater: boolean

Beta

Remarks

如果为 true,此实体可以在水中呼吸。

If true, this entity can breathe in water.

Throws

This property can throw when used.


canBreathe

实验性

readonly canBreathe: boolean

Beta

Remarks

如果为 true,该实体能够呼吸。

If true, the entity is able to breathe.

Throws

This property can throw when used.


entity

readonly entity: Entity

Beta

Remarks

拥有此组件的实体。如果实体已被移除,则实体将为 undefined

The entity that owns this component. The entity will be undefined if it has been removed.

Throws

This property can throw when used.

InvalidEntityError

Inherited from

EntityComponent.entity


generatesBubbles

readonly generatesBubbles: boolean

Beta

Remarks

如果为 true,此实体在水中时会显示可见的气泡。

If true, this entity will have visible bubbles while in water.

Throws

This property can throw when used.


inhaleTime

readonly inhaleTime: number

Beta

Remarks

恢复到最大呼吸量的时间(以秒为单位)。

Time in seconds to recover breath to maximum.

Throws

This property can throw when used.


isValid

readonly isValid: boolean

Beta

Remarks

返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。

Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

Inherited from

EntityComponent.isValid


suffocateTime

readonly suffocateTime: number

Beta

Remarks

窒息伤害之间的时间间隔(以秒为单位)。

Time in seconds between suffocation damage.

Throws

This property can throw when used.


totalSupply

readonly totalSupply: number

Beta

Remarks

实体可以屏住呼吸的时间(以秒为单位)。

Time in seconds the entity can hold its breath.

Throws

This property can throw when used.


typeId

readonly typeId: string

Beta

Remarks

组件的标识符。

Identifier of the component.

Inherited from

EntityComponent.typeId


componentId

readonly static componentId: "minecraft:breathable" = 'minecraft:breathable'

Beta

Methods

getBreatheBlocks()

getBreatheBlocks(): BlockPermutation[]

Beta

Returns

BlockPermutation[]

Remarks

此实体可以呼吸的方块列表,除了按方块类别区分的单独属性之外。

List of blocks this entity can breathe in, in addition to the separate properties for classes of blocks.

Throws

This function can throw errors.


getNonBreatheBlocks()

getNonBreatheBlocks(): BlockPermutation[]

Beta

Returns

BlockPermutation[]

Remarks

此实体不能呼吸的方块列表。

List of blocks this entity can't breathe in.

Throws

This function can throw errors.

同领域相关