Merk
Tilgang til denne siden krever autorisasjon. Du kan prøve å logge på eller endre kataloger.
Tilgang til denne siden krever autorisasjon. Du kan prøve å endre kataloger.
Extends
Represents the fluid container of a block in the world. Used with blocks like cauldrons.
Properties
fillLevel
fillLevel: number;
Relative fill level of the fluid container.
Type: number
Notes:
- This property can't be edited in restricted-execution mode.
fluidColor
fluidColor: RGBA;
Custom color of the fluid in the container.
Type: RGBA
Notes:
- This property can't be edited in restricted-execution mode.
Methods
addDye
addDye(dye: ItemType): void
Adds a dye to the fluid. The dye color is combined with any existing custom color.
Parameters
- dye: ItemType
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
getFluidType
getFluidType(): FluidType
Gets the current fluid type in the container.
Returns FluidType
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
setFluidType
setFluidType(fluidType: FluidType): void
Sets the current fluid type in the container.
Parameters
- fluidType: FluidType
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
setPotion
setPotion(itemStack: ItemStack): void
Sets a potion item in the container. Changes the container's fluid type to potion.
Parameters
- itemStack: ItemStack
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
Constants
componentId
static read-only componentId = "minecraft:fluid_container";
Type: string