#Can't find the error

8 messages · Page 1 of 1 (latest)

jagged sand
#

The script i wrote doesn't seem to have any errors, as KJS doesnt give me any complaints. The hammer, wrench and hammerSoft are defined variables at the beginning of the script, doesn't seem to be the issue either, the log parses everything without an issue...
when I didn't have The wrench or hammers in the script, it didn't work either...
thank for the help

ServerEvents.recipes(event => {

    let hammer = '#forge:tools/hammers'
    let wrench = '#forge:tools/wrenches'
    let hammerSoft = '#forge:tools/mallets'
 
    // @ts-ignore
    event.shaped(
        //Millstone
        'create:millstone', [
            'HC ',
            'SBS',
            'SSS'
        ], {
            C: 'create:cogwheel',
            S: '#forge:stone',
            B: 'minecraft:smooth_stone_slab',
            H: hammer
        }
    )

    // @ts-ignore
    event.shaped(
        //Water Pump
        'create:mechanical_pump', [
            'PCP',
            'FRF',
            'HPW'
        ], {
            P: '#forge:plates/iron',
            C: 'create:cogwheel',
            F: 'gtceu:copper_normal_fluid_pipe', 
            R: 'gtceu:iron_rotor',
            H: hammer,
            W: wrench
        }
    )

    // @ts-ignore
    event.shaped(
        //Encased Fan
        'create:encased_fan', [
            ' F ',
            'MCW',
            ' S '
        ], {
            F: 'railways:smokestack_diesel',
            C: 'create:andesite_casing',
            S: 'create:shaft',
            M: hammerSoft,
            W: wrench
        }
    )
});
trim martenBOT
#

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

dense monolithBOT
#

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

jagged sand
#

that's the log, doesn't show me any errors regarding the script

dense monolithBOT
#

Paste version of server.txt from @jagged sand

jagged sand
#

??tips

dense monolithBOT
# jagged sand ??tips

This is an example of how to use .forEachRecipe() for changing or adding new recipes using existing ones.

ServerEvents.recipes(e => {
  // 2x slabs -> 1x plank through shaped crafting
  e.forEachRecipe({ type: 'minecraft:crafting_shaped', output: '#minecraft:slabs' }, r => {
    let ingredients = r.originalRecipeIngredients // returns a List<Ingredient>
    let output = r.originalRecipeResult           // returns an ItemStack
    e.shaped(ingredients[0], ['S', 'S'], { S: output })
  })

  // 1x stair -> 1x plank through stonecutting
  e.forEachRecipe({ type: 'minecraft:stonecutting', output: '#minecraft:stairs' }, r => {
    let ingredients = r.originalRecipeIngredients
    let output = r.originalRecipeResult
    e.stonecutting(ingredients[0], output)
  })

  // change the output from logs to planks from 4x to 2x (this will replace old recipe)
  e.forEachRecipe({ type: 'minecraft:crafting_shapeless', input: '#minecraft:logs', output: '#minecraft:planks' }, r => {
    let ingredients = r.originalRecipeIngredients
    let output = r.originalRecipeResult
    e.shapeless(Item.of(output.id, 2), ingredients[0]).id(r.getOrCreateId())
  })
})
jagged sand
#

??tips