Fluid

Use the fluid requirement in a KubeJS recipe

Use one of these methods to add a Fluid Requirement to the recipe.

.requireFluid(fluid)
.requireFluid(fluid, "tank")

.requireFluidTag("tag", amount)
.requireFluidTag("tag", amount, nbt)
.requireFluidTag("tag", amount, "tank")
.requireFluidTag("tag", amount, nbt, "tank")

.produceFluid(fluid)
.produceFluid(fluid, "tank")

.requireFluidPerTick(fluid)
.requireFluidPerTick(fluid, "tank")

.requireFluidTagPerTick("tag", amount)
.requireFluidTagPerTick("tag", amount, nbt)
.requireFluidTagPerTick("tag", amount, "tank")
.requireFluidTagPerTick("tag", amount, nbt, "tank")

.produceFluidPerTick(fluid)
.produceFluidPerTick(fluid, "tank")
  • The fluid param must be created using Fluid.of() KubeJS method. Example : Fluid.of("minecraft:water", 1000)

  • The tank param must be a string corresponding to a tank id defined in a custom machine json Fluid Component tank property.

  • The tag param must be a string starting with # defining a valid tag id. Example : "#minecraft:water"

  • The amount param must be a positive integer.

  • The nbt param must be a map. Example: {nbt1: 1, nbt2: "something"}.

Example

ServerEvents.recipes(event => {

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireFluid(Fluid.of("minecraft:water", 1000))
  
})

Last updated