From what I've read the Kubejs "assets" folder can be use like a resource pack, so I'm trying to use it to alter lang files, but when ever I put the files in and make it take effect, the game completely breaks, and I need to remove everything from the assets folder to make it able to even start up again. Said lang files work completely fine when they're in a normal resourcepack, so whats different in this case?
#Help with altering lang files via assets folder
65 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
wierd load order stuff
use the event
ClientEvents.generateAssets(event => {
event.addLang('lang.key', 'Lang Key Translation')
})
Ok, and where would I put this code. startup_scripts?
oh, wait
do I just put in the code as you wrote it, or do I need to rename some of the strings to match stuff that'll be in the resource folder?
client scripts
as i wrote it, with the key and translation as you want (ie event.addLang('item.minecraft.apple', 'Poison'))
OH, so instead of the resources handling the translation, the client script handles it in said format?
yes
hmm, quick question: something like this:
"wood_type.quark.azalea" : "Verdiant"
would still work in that format, yeah?
yes
Alright
uhh, I don't need to put the code in resources as well, do I?
Cause I put this code:
ClientEvents.generateAssets(event => {
event.addLang('item.quark.azalea_boat', 'Verdiant Boat')
event.addLang('item.quark.azalea_chest_boat', 'Verdiant Boat with Chest')
event.addLang('block.quark.azalea_planks', 'Verdiant Planks')
event.addLang('wood_type.quark.azalea', 'Verdiant')
})
``` into the script file in client script, and booted up the game
and it has not taken effect
anything in logs/kubejs/client.txt?
[01:18:46] [INFO ] client_scripts:script.js:3: Hello, World! (You will see this line every time client resources reload)
! [01:18:46] [ERR] client_scripts:script.js:9: Unknown event 'ClientEvents.generateAssets'!
[01:18:46] [INFO ] Loaded script client_scripts:script.js in 0.003 s
[01:18:46] [INFO ] Loaded 1/1 KubeJS client scripts in 0.022 s
thats all thats in it rn
??kjs6wiki
Here is a list of all events in KubeJS 6.0!
ah its highPriorityAssets not generateAssets
ah, I see
it still doesn't seem to be taking effect. Do the resourcepacks need to be ordered in a specific way for it to work?
how are you reloading?
Ok, I reloaded w/ f3 +t and it
sorta works?
the ```js
event.addLang('wood_type.quark.azalea', 'Verdiant')
check the client.txt log file for errors
[01:31:53] [INFO ] client_scripts:script.js:3: Hello, World! (You will see this line every time client resources reload)
[01:31:53] [INFO ] Loaded script client_scripts:script.js in 0.043 s
[01:31:53] [INFO ] Loaded 1/1 KubeJS client scripts in 0.192 s
``` No errors listed
haven't tried that yet, but it's worth a shot
One full restart later and nope, the name changes aren't taking effect for eveything besides the wood type.
Maybe quark does something different with it's lang system?
Wait
would not putting commas mess up things with the code
a mod author would have to be very dumb and determined to use a different lang system
and i know vaskii isnt a dumb mod author
if a comma is required there, then yes
tho usually it would fail earlier and show an error in the log
hmmm
would having .addlang code that calls upon multie different mods in the```js
ClientEvents.highPriorityAssets()
it shouldnt
I really don't know whats going on here. Thanks for your help, tho.
I think I'ma throw in the towel for tonight and see if I there's some answers in the morning. For now, here's the code I'm working with:
// priority: 0
console.info('Hello, World! (You will see this line every time client resources reload)')
JEIEvents.hideItems(event => {
// Hide items in JEI here
// event.hide('minecraft:cobblestone')
})
ClientEvents.highPriorityAssets(event => {
event.addLang('item.quark.azalea_boat', 'Verdiant Boat'),
event.addLang('item.quark.azalea_chest_boat', 'Verdiant Boat with Chest'),
event.addLang('block.quark.azalea_planks', 'Verdiant Planks')
})
ClientEvents.highPriorityAssets(event => {
event.addLang('wood_type.quark.azalea', 'Verdiant')
})
``` if anyone sees anything wrong here me n ArugChief ain't seeing, please let us know.
Work up earlier then I should've, so gonna try and get some more rest, but before I forget: could the name of the script file have any effect on things?
it really shouldnt
unless you have multiple scripts with the same event doing very similar things
Done some experiments, seems like there are quite a few other mods besides quark that can't get name changed by event.addLang(). Haven't noticed any pattern to it. Maybe it's something to do with the way certain mod's Lang files are set up?
regardless, seeing as it's effecting several other mods, I think the issue may be on Kubejs's end. Though that diesn't mean there might not be a solution.
has there been any cases in the past of someone using the event.addLang() command to alter Alex's Mobs, Sully's Mod, or Quark, and it working?
If so that means the issue is something exclusive to newer versions of Kubejs, and I could just downgrade my version to bypass the problem
Not sure if we'll find a solution to this issue any time soon, but in the mean time I was able to acheve what I wanted via a different mod.
With that in mind: Should we close this thread?
leave it open
I've just encountered the same issue, also with Quark. Using newest KubeJS and trying to rename Quark's Chute, either via lang file or client script, does not work, while the client script does work for non-Quark items.
@pseudo lodge Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!
Ok there's a good chance I'm gonna leave this server in a bit (not because of anything this server has done wrong, just haven't been active here in millenia), but that begs the question on what fate this ticket should have
Cause like I know the problem probably was never resolved, but I don't know what will happen to this if I leave w/o closing it
it will sit around
eventually someone will probably realize you left and close it
or the something will happen that fixes the bug and someone will close it for that
There are threads which are on the fourth unresolved message
So no worries then?
yeah
Alright then. I'll be on my way then.
I'll probably see ya'll again someday when I get back into messin with kubejs. Until them, I wish you all well!
@pseudo lodge Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!
User left, closing