#1.20 fluids examples/ documentation?

34 messages · Page 1 of 1 (latest)

bleak junco
#

The fluid examples on the wiki arent working for 1.20.1 fabric is ther eany documentation on it or does anyone just have some examples?

hushed wrenBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

distant widget
#

??neversay

hearty quarryBOT
# distant widget ??neversay

Never say 'it crashed', 'it errored' or 'it didn't work' without providing the full error message/crash report!

distant widget
#

??kjslogs

hearty quarryBOT
# distant widget ??kjslogs

You can find your KubeJS server log in /minecraft/logs/kubejs/startup.log.
If you are on 1.18 or below it will be called startup.txt.
Please send it if asked, as it contains helpful information.

bleak junco
#

Oh sorry I thought it was just me using the wrong documentation so I think the exact issues would be needed I'll get the different issues I had in just a minute

distant widget
bleak junco
#

so this is what i get from just copying the fluid example under my item registries

[01:34:06] [INIT] KubeJS 2001.6.3-build.45; MC 2001 fabric
[01:34:06] [INIT] Loaded plugins:
[01:34:06] [INIT] - dev.latvian.mods.kubejs.fabric.BuiltinKubeJSFabricPlugin
[01:34:06] [INIT] - com.tom.createores.kubejs.KubeJSExcavation
[01:34:08] [INFO] example.js#5: Hello, World! (Loaded startup scripts)
[01:34:08] [ERROR] ! Error loading KubeJS script: startup_scripts:example.js': Line 32: 'onEvent()' is no longer supported! Read more on wiki: https://kubejs.com/kjs6
[01:34:08] [INFO] Loaded 0/1 KubeJS startup scripts in 1.115 s

but the link has no info on what to do with fluids

#

im gonna try replacing the onevent with the newer item version and just replace item with fluid

celest bramble
#

??code

hearty quarryBOT
# celest bramble ??code

🗒️**Send the code!**🗒️
You may have an issue with a KubeJS script and you explain it to the best of your ability yet without the actual code in question we have very little to go off of in trying to assist you.

distant widget
#

it says what your issue is tho

#

you're using 1.18 syntax in 1.20

#

??kjswiki

hearty quarryBOT
distant widget
#

is this updated

#

uh

#

no

#

do you use probe

#

??kjsaddons

hearty quarryBOT
# distant widget ??kjsaddons

ProbeJS is an addon mod for KubeJS that generates typings files for VSCode, allowing VSCode to offer autocompletions for a ton of things!

Mod by @narrow sierra

bleak junco
#

yeah i just cant find an example of the 1.20 syntax for fluids, i did get the registry issue figured out but now

hearty quarryBOT
#

Paste version of startup.log from @bleak junco

bleak junco
#
// priority: 0

// Visit the wiki for more info - https://kubejs.com/

console.info('Hello, World! (Loaded startup scripts)')

// Listen to item registry event
StartupEvents.registry('item', e => {
    // The texture for this item has to be placed in kubejs/assets/kubejs/textures/item/test_item.png
    // If you want a custom item model, you can create one in Blockbench and put it in kubejs/assets/kubejs/models/item/test_item.json
    e.create('test_item')
    
    // If you want to specify a different texture location you can do that too, like this:
    e.create('test_item_1').texture('mobbo:item/lava') // This texture would be located at kubejs/assets/mobbo/textures/item/lava.png
    
    // You can chain builder methods as much as you like
    e.create('test_item_2').maxStackSize(16).glow(true)
    
    // You can specify item type as 2nd argument in create(), some types have different available methods
    e.create('custom_sword', 'sword').tier('diamond').attackDamageBaseline(10.0)







  })


  // Startup script
  StartupEvents.registry('fluid', 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)
    
 
    })
  

``` ⬅️
#

no ill go ahead and grab that mod

#

also the item thing alone was workign fine before adding the fluids

#

and i know the comments itself says its old syntax, i just cant find anything on the new one which is why im mostly inneed of examples

#

ohhhh the example code has several fluids named the same thing thats the duplicate it mentions

#

okay with that setup i got it working ill make a quick template and post to examples

bleak junco
#

Template for those looking (I didn't know this was accessible after close)

   //1.20.1 Fabric FLuid
  //In Startup script
  StartupEvents.registry('fluid', e => {
    
    
    // Basic "thick" (looks like lava) fluid with red tint
    e.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
    e.create('thin_fluid')
      .thinTexture(0xFF0000)
      .bucketColor(0x00FFFF)
      .displayName('Thin Fluid')
      .noBucket() 
      .noBlock() 
       
       
        
        e.create('strawberry_cream')
        .displayName('Strawberry Cream')
      .stillTexture('kubejs:block/strawberry_still') 
      .flowingTexture('kubejs:block/strawberry_flow')
      .bucketColor(0xFF33FF)
      
 
    })
  
#

And a version that explains it in more detail

  //1.20.1 Fabric FLuid
  //In Startup script
  StartupEvents.registry('fluid', e => {
    
    
    // Basic "thick" (looks like lava) fluid with red tint
    e.create('thick_fluid') // ('') contains the fluid id
        //sets the texture to thick
      .thickTexture(0xFF0000) // () conatins the hex code, prefixed by 0x, of the color of the fluid
      .bucketColor(0xFF0000) //  () conatins the hex code, prefixed by 0x, of the color of the fluid in the bucket, usually the same 
      .displayName('Thick Fluid') //in  game name of fluid
                 
    // Basic "thin" (looks like water) fluid with cyan tint, has no bucket and is not placeable
    e.create('thin_fluid')
     //sets the texture to thin
      .thinTexture(0xFF0000)
      .bucketColor(0x00FFFF)
      .displayName('Thin Fluid')
      .noBucket() //adding this will cause the fluid to have no ability to go in a bucket, but will still be able to be placed into the world by machines like create mod pipe unless .noBlock() is also added
      .noBlock() //adding this will cause the fluid to not be able to placed into the world, but will still have a bucket unless .noBucket() is also added, this is useful for moving fluids between machines
        //adding both means the fluid only exists inside machines and pipes and possible modded bucket alternatives like canisters
       
        //fluid with custom texture
        e.create('strawberry_cream')
        .displayName('Strawberry Cream')
      .stillTexture('kubejs:block/strawberry_still') 
      .flowingTexture('kubejs:block/strawberry_flow')
      .bucketColor(0xFF33FF)
      
 
    })
  
celest bramble