类 BlockFluidContainerComponent预览版 实验性

Represents the fluid container of a block in the world. Used with blocks like cauldrons.

层级 (查看完整内容)

属性

block: Block

Block instance that this component pertains to.

fillLevel: number

Relative fill level of the fluid container.

无法在只读模式下修改此属性,详见 WorldBeforeEvents

fluidColor: RGBA

Custom color of the fluid in the container.

无法在只读模式下修改此属性,详见 WorldBeforeEvents

typeId: string

Identifier of the component.

componentId: "minecraft:fluidContainer" = 'minecraft:fluidContainer'

方法

  • 实验性

    参数

    返回 void

    Adds a dye to the fluid. The dye color is combined with any existing custom color.

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

    This function can throw errors.

    Error

  • 实验性

    返回 boolean

    Whether the component is valid.

    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.

  • 实验性

    参数

    返回 void

    Sets a potion item in the container. Changes the container's fluid type to potion.

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

    This function can throw errors.

    Error