Class: EntityBreathableComponent
entity componentBeta
定义此实体可以在哪些方块中呼吸,并赋予它们窒息的能力。
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
readonlybreathesAir:boolean
Beta
Remarks
如果为 true,此实体可以在空气中呼吸。
If true, this entity can breathe in air.
Throws
This property can throw when used.
breathesLava
readonlybreathesLava:boolean
Beta
Remarks
如果为 true,此实体可以在熔岩中呼吸。
If true, this entity can breathe in lava.
Throws
This property can throw when used.
breathesSolids
readonlybreathesSolids:boolean
Beta
Remarks
如果为 true,此实体可以在实心方块中呼吸。
If true, this entity can breathe in solid blocks.
Throws
This property can throw when used.
breathesWater
readonlybreathesWater:boolean
Beta
Remarks
如果为 true,此实体可以在水中呼吸。
If true, this entity can breathe in water.
Throws
This property can throw when used.
canBreathe
实验性
readonlycanBreathe:boolean
Beta
Remarks
如果为 true,该实体能够呼吸。
If true, the entity is able to breathe.
Throws
This property can throw when used.
entity
readonlyentity: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.
Inherited from
generatesBubbles
readonlygeneratesBubbles:boolean
Beta
Remarks
如果为 true,此实体在水中时会显示可见的气泡。
If true, this entity will have visible bubbles while in water.
Throws
This property can throw when used.
inhaleTime
readonlyinhaleTime:number
Beta
Remarks
恢复到最大呼吸量的时间(以秒为单位)。
Time in seconds to recover breath to maximum.
Throws
This property can throw when used.
isValid
readonlyisValid: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
suffocateTime
readonlysuffocateTime:number
Beta
Remarks
窒息伤害之间的时间间隔(以秒为单位)。
Time in seconds between suffocation damage.
Throws
This property can throw when used.
totalSupply
readonlytotalSupply:number
Beta
Remarks
实体可以屏住呼吸的时间(以秒为单位)。
Time in seconds the entity can hold its breath.
Throws
This property can throw when used.
typeId
readonlytypeId:string
Beta
Remarks
组件的标识符。
Identifier of the component.
Inherited from
componentId
readonlystaticcomponentId:"minecraft:breathable"='minecraft:breathable'
Beta
Methods
getBreatheBlocks()
getBreatheBlocks():
BlockPermutation[]
Beta
Returns
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
Remarks
此实体不能呼吸的方块列表。
List of blocks this entity can't breathe in.
Throws
This function can throw errors.
