[08
54] [INIT] KubeJS 2001.6.5-build.16; MC 2001 forge
[08
54] [INIT] Loaded plugins:
[08
54] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgePlugin
[08
54] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgeClientPlugin
[08
54] [INIT] - com.probejs.ProbeJSPlugin
[08
54] [ERROR] ! example.js#5: ReferenceError: "event" is not defined.
[08
54] [INFO] Loaded 0/1 KubeJS server scripts in 0.094 s with 1 errors and 0 warnings
[08
54] [INFO] Scripts loaded
[08:51:04] [INFO] Server resource reload complete!
#'event' is not defined
126 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
this is my code
ServerEvents.recipes(event => {
event.remove({output: 'projecte:red_matter'})
event.remove({output: 'projecte:dark_matter'})
})
yep
ive been at this for a fucking hour
just trying to remove 2 things
im using probejs
When you hover over ServerEvents does it give you any information showing that it's correct? Same with the event variable?
Both of those basically say that it should be working.
How about adding this to the top of the file:
//priority: 0
//@ts-check
The ts check will make vscode respond to inaccuracies between your script and the type script generated by probeJS. so with that, it might give us some hints of a problem even if it has a lot of false positives.
The other header is the priority one, it lets you decide which scripts to be run in what order so by setting it to zero it's a hope that this will fix a script running before it is supposed to and ending up with undefined varibles.
like this?
Yeah that should help. Now can you try /reload to see if it works?
From the looks of things not even ts check is showing problems.
What do the errors say..?
ill try?
like this?
ServerEvents.recipes(e => {
e.remove({output: 'projecte:red_matter'})
e.remove({output: 'projecte:dark_matter'})
})
Yeah, and at this point it's not something I've encountered and it should be working. The answer might be really difficult now but if you find the answer you'll likely not have this issue in the future.
ughhhh hopefully
still broken! kill me!
I don't mean to make you run around a cage, and I know it can be fustrating to feel like nothing is working but what you are doing is finding all the ways that don't work so that you can find the way that does.
That just takes time.
its ok, im glad your helping
better than the 40 minutes of me ramming my head into the desk
ill send the most recent log
[09:15:03] [INIT] KubeJS 2001.6.5-build.16; MC 2001 forge
[09:15:03] [INIT] Loaded plugins:
[09:15:03] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgePlugin
[09:15:03] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgeClientPlugin
[09:15:03] [INIT] - com.probejs.ProbeJSPlugin
[09:15:03] [ERROR] ! example.js#5: ReferenceError: "event" is not defined.
[09:15:03] [INFO] Loaded 0/1 KubeJS server scripts in 0.007 s with 1 errors and 0 warnings
[09:15:03] [INFO] Scripts loaded
[09:15:09] [INFO] Server resource reload complete!
Heh, sure is! Now the next try is maybe setting a null check like this:
if(!e) return;
That should make it so the script is only going to run when event is defined.
This is likely going to do two things however. It's either going to make the recipe not show up, or it's only going to work when the recipe is actually ready to be called.
ServerEvents.recipes(e => {
if(!e) return;
e.remove({output: 'projecte:red_matter'})
e.remove({output: 'projecte:dark_matter'})
})```
So if it doesn't cause a error you should still check for recipes that make dark_matter
as long as its not craftable i dont care lmao
Aye if it works it works
ServerEvents.recipes(e => {
e.remove({output: 'projecte:red_matter'})
e.remove({output: 'projecte:dark_matter'})
})

just saving that there
Good idea
What's this one this time?

If have to ask, are you using the most updated version of KubeJS? Even if it shouldn't be the cause of this issue.
most updated for 1.20.1
did you save the file
I assumed he did...
your last pic that shows the script tab shows its unsaved
oh?
i might be the slightest bit stupid
white dot = unsaved
im new to vcs im sorry

i am not mad at you and there's no reason to apologize...
I mean if it works it works. Is it working?

yeah yeah bully the coding noob
Okay, I assumed you knew more about this but since I now know how much you might not know I'm going to tell you this in what might seem like a condescending manner.
When you save and reload there is almost this copy of the file stored in the game's memory. it's different from the file you edit, and it's helpful to have this barrier between what the computer has and what we are actively editing.
So, when we are finished and want to give the game the new script, we can sometimes just save the file (usually ctrl+s, but you can also right click on the tab of the open file where it's name is to see a menu for this) and we tell our computer this is the new file. Since we saved it.
Now, when you /reload the game gets all the new things like our script we just saved, and loads it up to run. So if you don't save it, nothing changes, and it can start producing the same error multiple times even if you edit the unsaved file.
Am I making sense? Save the file to submit it to the game so it can run it. It cannot run a unsaved file.
thats fucking adorable
It's why it's favorited
you should have just said control s, but yes, i get it
You're doing better than some, I had a friend who was 20 years older than me who didn't know how to open a folder.

seriously. it took two people and 30 plus mins to explain fundamentals about directories and why you had to place a folder in a specific spot for a game to access and name it correctly.
holy

we got it done
and in the end, we didn't even play

All right so how's that script working?

.

but ill do it now
All right
all i had to do was press control s fmll
i leave you in the result of your trials and effort. go on young master.
danke
what is going on here
oh
oh
mood fr
I feel that
when I started working with kjs I had a very similar issue
I was just editing a different file
🔥
anyways
real

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue!
This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.
Do you have any other questions regarding your issue? Feel free to ask!
Note: You should create a new post for unrelated issues.
bye bye
Ticket closed!
thank you
