#undefined function

16 messages · Page 1 of 1 (latest)

frigid jackal
#

I receive an error, saying that the function crushing is undefined

let crushing (material) => {
    event.recipes.createCrushing([`2x gtceu:crushed.${material}`, 'gtceu:dust.stone'], `kubejs:${material}_ore_chunk`)
}
let materials = ["diamond","almandine","aluminium","beryllium","cassiterite","chalcopyrite","coal","cobalt","cobaltite","copper","emerald","galena","garnierite","gold","graphite","iron","lapis","lazurite","lead","nickel","palladium","platinum","redstone","silver","thorium","tin","pyrite","grossular","bentonite","cinnabar","magnesite","malachite","olivine","pyrolusite","pyrope","ruby","spessartine","tantalite","yellow_limonite","green_sapphire"]
materials.forEach(material => crushing(material))
marsh estuaryBOT
#

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

frigid jackal
#

it's not a typo, and I define the function b4 I call it

prime swan
#

let crushing (material) => {}
change it to
let crushing = (material) => {

frigid jackal
#

forgot the mf'ing equal sign

#

omg

prime swan
#

im surprised your code editor didnt scream at you in agony

#

mine is

frigid jackal
#

np++ doesn't seem to care

#

it detects the js language

#

but is chilling xD

prime swan
#

npp is a text editor

winter elkBOT
#

If you're working with KubeJS scripts, configuration files, or similar things, we generally recommend using an actual IDE rather than just Notepad and its various siblings. In a lot of cases, it can help you with finding errors in your code faster and also gives you neat features like syntax highlighting, automatic formatting, et cetera! We recommend Visual Studio Code, since it's lightweight(-ish) and works very well with JavaScript files out-of-the-box.

frigid jackal
#

I need to get rid of np++ and change the default program of several file extensions

#

yeah that was the issue, thanks