Custom Fluids

Supported by Forge on all versions, and Fabric on 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')
    .thickTexture(0xFF0000)
    .bucketColor(0xFF0000)
    .displayName('Thick Fluid')
               
  // Basic "thin" (looks like water) fluid with cyan tint, has no bucket and is not placeable
  event.create('thick_fluid')
    .thinTexture(0xFF0000)
    .bucketColor(0x00FFFF)
    .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.textureThick(0xFF0000) // the texture method names are different in 1.18.1 and below, textureXyz instead of xyzTexture
       fluid.bucketColor(0xFF0000)
       fluid.displayName('Thick Fluid')
  })
})