#how do I convert this script to use kubejs create?

26 messages · Page 1 of 1 (latest)

elfin marsh
#
ServerEvents.recipes(event => {

  let craft = (output, input, inNum) => {

    event.custom({
      "type": "create:compacting",
      "ingredients": [
        { "fluid": input, "nbt": {}, "amount": inNum }
      ],
      "results": [
        { "item": output }
      ]
    })
      .id(`cot:kubejs/${output.replace(':', '-')}_by_create-compacting`)

  }

  craft('kubejs:oil_droplet', 'kubejs:oil', 1)
  craft('kubejs:oil_drop', 'kubejs:oil', 9)
  craft('kubejs:oil_mb', 'kubejs:oil', 81)
  craft('kubejs:somehow_enhanced_oil_droplet', 'kubejs:somehow_enhanced_oil', 1)
  craft('kubejs:somehow_enhanced_oil_drop', 'kubejs:somehow_enhanced_oil', 9)
  craft('kubejs:somehow_enhanced_oil_mb', 'kubejs:somehow_enhanced_oil', 81)

})

the fluid amounts being in droplets is important

desert fulcrumBOT
#

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

bleak citrus
#

are droplets item or fluid

pine current
#

It's practically the same thing you're already doing, just change it from e.custom

#

I think droplets are equivalent to mB

#

Oh nvm thats an item

sinful swallowBOT
#

KubeJS Create is an addon that will allow you to use KJS scripts with Create more easily.

bleak citrus
#
function craft(output, input_item, input_amount) {event.recipes.createCompacting(output, Item.of(input_item, input_amount))}
elfin marsh
#

also kubejs:oil_droplet is an item

pine current
#

Yeah I noticed that, sorry

pine current
#

It has to be event.recipes.create.compacting

bleak citrus
#

oh..

#

wait what?

#

it works

pine current
#

It shouldn't

bleak citrus
#

my pack is on 1.19.2

pine current
#

now I'm proper confused...

elfin marsh
#

apparently the wiki just doesn't have a good example of a fluid wrapper

#

I needed craft('kubejs:oil_droplet', Fluid.of('kubejs:oil', 1))

#

but the wiki only seems to have it like Fluid.water(10)

bleak citrus
#

well Fluid.of('kubejs:oil, 1) should work

elfin marsh