Skip to main content

Custom Fluids

Supported by Forge on all versions, and Fabric noton supported yet!1.18.2+

// Startup script
onEvent('fluid.registry', event => {
  // These first examples are 1.16.5 and 1.18.2 syntax
  
  // Basic "thick" (looks like lava) fluid with red tint
  event.create('thick_fluid',)
    fluid => {
    fluid.textureThick(.thickTexture(0xFF0000)
    fluid..bucketColor(0xFF0000)
    fluid..displayName('Thick Fluid')
  })
               
  // Basic "thin" (looks like water) fluid with cyan tinttint, has no bucket and is not placeable
  event.create('thick_fluid',)
    fluid => {
    fluid.textureThin(.thinTexture(0xFF0000)
    fluid..bucketColor(0x00FFFF)
    fluid..displayName('Thin Fluid')
  	}.noBucket() // both these methods are 1.18.2+ only
  	.noBlock() 
  
  // Fluid with custom textures
  event.create('strawberry_cream')
  	.displayName('Strawberry Cream')
    .stillTexture('kubejs:block/strawberry_still')
    .flowingTexture('kubejs:block/strawberry_flow')
    .bucketColor(0xFF33FF)
  
  // For 1.18.1 the syntax is slightly different
  event.create('thick_fluid', fluid => {
       fluid.displayName('Strawberry Cream')
    fluid.textureStill('kubejs:block/strawberry_still')
    fluid.textureFlowing('kubejs:block/strawberry_flow')
    fluid.bucketColor(0xFF33FF)
  })textureThick(0xFF0000) // asthe always,texture formethod KubeJSnames 3are /different Minecraftin 1.16,18.1 theseand callsbelow, needtextureXyz toinstead beof chainedxyzTexture
       instead, so for example
  event.create('thick_fluid')
       .textureThick(0xFF0000)
       .fluid.bucketColor(0xFF0000)
       .fluid.displayName('Thick Fluid')
  })
})