Add handle for top level files
TiphaineLAURENT opened this issue ยท 2 comments
Hi ๐
Could you add support for top level files ?
By top level I mean : kubejs/
The goal of this feature is to be able to handle common file like constants:
// kubejs/constants.js
const removedItemsId = [...]
// kubejs/client_scripts/jei.js
onEvent('jei.hide.items', event => {
event.hide(removedItemsId)
})
// kubejs/server_scripts/remove.js
onEvent('recipes', event => {
removedItemsId.forEach(removedItemId => {
event.remove({ input: removedItemsId })
event.remove({ output: removedItemsId })
}
})
There's a global
object you can use to share things across script types ^^
Just add a startup script that has global.removedItemsId = [โฆ]
and then you can use that across files
There's a
global
object you can use to share things across script types ^^Just add a startup script that has
global.removedItemsId = [โฆ]
and then you can use that across files
Is there any way I can contribute to https://mods.latvian.dev/books/kubejs ?