#loooooooooooooooooooooopppppppsssssssssss

99 messages · Page 1 of 1 (latest)

iron oriole
#
const ingots = ['copper', 'diamond', 'electrum', 'gold']
const bIngredients = ['thermal:copper_plate', 'kubejs:diamond_plate', 'thermal:electrum_plate', 'thermal:gold_plate']

ingots.forEach((ingot, index) => {
    const rod = `${ingot}_rod`
    const bIngredient = bIngredients[index]

    ServerEvents.recipes((event) => {
        event.shaped(`kubejs:${rod}`, [
            'AB ',
            '   ',
            '   '
        ], {
            A: 'kubejs:saw',
            B: bIngredient
        }).damageIngredient('kubejs:saw')
    })
})
vagrant totemBOT
#

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

iron oriole
#

please help i really suck at this

night sand
#

Just change const to let

iron oriole
#

😮

night sand
#

You can also delete all the empty lines and columns in the pattern

iron oriole
#

damn

night sand
#

Just leave it as ['AB']

iron oriole
#

it feels wrong for me 😩

night sand
iron oriole
#

it doesnt work

night sand
#

Wdym confused_dog_lex

iron oriole
#

same error

#

changed const to let

night sand
#

Oh wait it's the list

iron oriole
night sand
#

You're redefining the list somewhere

#

Which you can't so if you use const, that's what const is for

#

Somewhere else in your script

iron oriole
#

the script is empty

#

WAIT

night sand
#

Your error says the thing exists already

halcyon dirge
#

do you have another script file using the exact same variable?

iron oriole
#

ARE THE VARIABLES PUBLIC ?

night sand
#

Global

#

Yes

iron oriole
#

WAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

night sand
#

All files are loaded into a global scope

nimble wave
#

global varibales are accessible anywhere in a project

halcyon dirge
#

well within the scope of whichever of the 3 folders you're in

iron oriole
#

ty

night sand
#

When you see 10 files, kjs only sees 1 file

iron oriole
night sand
#

Pic is not loading for me

halcyon dirge
#

I personally prefer maps to dual lists, but that's just me

night sand
#

Same uwu

iron oriole
#

speaking chinese

nimble wave
#

Sort of, based on the documentation it separates the "1 file" in segments based on loading. Startup at launch, server at world launch (I think) and client is just localization etc.

iron oriole
#

i made a cool macro for /kubejs hand

#

*Numpad0::
    SendInput, {t}  ; Presses the T key to open the chat
    Sleep 100
    SendInput, /kjs_hand{Enter}  ; Sends the command /kjs_hand and presses Enter
return`
halcyon dirge
iron oriole
#

thanks chatgpt

nimble wave
#

Just think of KJS as 1 big container and anything you define is defined in any script you make.

halcyon dirge
#

there is a global variable though that crosses the 3 namespaces

iron oriole
#

honestly it should be a key in KubeJS

night sand
#

Wait why do you have a macro. For. It

halcyon dirge
#

should read the changelogs, it's coming in the future

iron oriole
#

cuz i used to write it each time

#

😩

night sand
#

Just make a dev item, or make the stick a right click function to run the reload command

halcyon dirge
#

will have a keybind that opens a gui that gives you all the info on an object

iron oriole
#

not reload

night sand
#

Ah misread

#

You can still do that with offhand stick lol

#

Main hand = reload, offhand = item in hand :D

#

Thats what I would do

#

Cheeky like that

iron oriole
#

i don't call myself a dev

#

i can only understand code that is written

#

but can't write it myself

night sand
#

I dint either, but having a dev item sounds cool

nimble wave
#

Most developers don't make their own code, they just take public code and make it work for their own problems. That's like 70% of development.

#

Prime example: Stack Overflow

iron oriole
#

xD

#

btw

#

it doesnt take the cast

nimble wave
#

I honestly recommend against using the addon mods and using the JSON method via the recipe builder from Thermal. Its more direct IMO and doesn't seem to fail.

iron oriole
#

i swear ThermalJS is so broke

#

Botania kubejs doesnt even LOAD

#

fuck

night sand
#

Im pretty sure it only takes 2 parameters

#

With a list of 2 inputs as the second param

iron oriole
#

WAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHH

#

:

night sand
iron oriole
#

against using JSON ?

iron oriole
night sand
#

Lol

iron oriole
#

ty

#

you clearly deserve your prize waaaaaaahhhhhhh

night sand
nimble wave
# night sand I highly recommend against that.

I meant the JS JSON methods not actually json.

event.custom({
            type: 'create:splashing',
            ingredients: [
                {
                    'item': `kubejs:crushed_raw_${entry.material}`
                }
            ],
            results: [
                {
                    'count': 9,
                    'item': `kubejs:nugget_${entry.material}`
                }
            ]
        }).id(`kubejs:create/splashing/crushed_raw_${entry.material}`)
night sand
#

Same thing for my context

#

Little to no difference :p

nimble wave
#

Why do you recommend against it? It seems to work flawlessly for me 🤔

lucid falcon
#
event.custom({
    type: 'create:splashing',
    ingredients: [
        { 'item': `kubejs:crushed_raw_${entry.material}` }
    ],
    results: [
        { 'item': `kubejs:nugget_${entry.material}`, 'count': 9 }
    ]
}).id(`kubejs:create/splashing/crushed_raw_${entry.material}`)

You don't have to follow the JSON curly bracket split for each line btw and can make it more readable like this

nimble wave
#

I just use a code formatter in VSC keeps all my code formatted in the same way.