Class: BlockFluidContainerComponent
block inventory componentBeta
表示世界中方块的流体容器。用于像炼药锅这样的方块。
Represents the fluid container of a block in the world. Used with blocks like cauldrons.
Extends
Properties
block
readonlyblock:Block
Beta
Remarks
此组件所属的方块。
Block instance that this component pertains to.
Inherited from
fillLevel
fillLevel:
number
World Mutation Beta
Remarks
流体容器的相对填充液位。
Relative fill level of the fluid container.
fluidColor
fluidColor:
RGBA
World Mutation Beta
Remarks
容器中流体的自定义颜色。
Custom color of the fluid in the container.
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
typeId
readonlytypeId:string
Beta
Remarks
组件的标识符。
Identifier of the component.
Inherited from
componentId
readonlystaticcomponentId:"minecraft:fluid_container"='minecraft:fluid_container'
Beta
Methods
addDye()
addDye(
dye):void
World Mutation Beta
Parameters
dye
Returns
void
Remarks
向流体中添加染料。染料颜色将与任何现有的自定义颜色合并。
Adds a dye to the fluid. The dye color is combined with any existing custom color.
Throws
This function can throw errors.
getFluidType()
getFluidType():
FluidType
World Mutation Beta
Returns
Remarks
获取容器中当前的流体类型。
Gets the current fluid type in the container.
Throws
This function can throw errors.
setFluidType()
setFluidType(
fluidType):void
World Mutation Beta
Parameters
fluidType
Returns
void
Remarks
设置容器中当前的流体类型。
Sets the current fluid type in the container.
Throws
This function can throw errors.
setPotion()
setPotion(
itemStack):void
World Mutation Beta
Parameters
itemStack
Returns
void
Remarks
在容器中设置一个药水物品。将容器的流体类型更改为药水。
Sets a potion item in the container. Changes the container's fluid type to potion.
Throws
This function can throw errors.
