#custom tool tier not working
1 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
is this correct though:
StartupEvents.registry('item.tool_tiers', event => {
the 1.19 switch for certain things is unclear
the whitespace wasnt the issue, i just tested
like this?
StartupEvents.toolTierRegistry('item.tool_tiers', event => {
ItemEvents.toolTierRegistry
ItemEvents.toolTierRegistry('item.tool_tiers', event => {
like that?
just event
ItemEvents.toolTierRegistry(event => {
event.add('void_worm_gu', tier => {
tier.uses = 2067
tier.speed = 8.0
tier.attackDamageBonus = 1.0
tier.level = 4
tier.enchantmentValue = 15
tier.repairIngredient = 'minecraft:diamond'
})
})
like this?
yes
thanks! ill test it
this will help you in the future figuring out what 1.19 events should look like
https://mods.latvian.dev/books/kubejs/page/list-of-events
I would have to know what the command is no?
/kjswiki uwu
yeah, but see I don't use it for it to be a habit at this point lol
well the use is that you dont have to write the message, just click a button 
This is a list of all the events. Choose your version.
why would it be that i cant use a repair item that i registered earlier in the code though ?
Paste version of script.js from @rocky yew
not working :/
Paste version of new_items.js from @grand elk
try this file instead of yours and when youre in the game send me the startup log
Please send your startup.txt log file.
You can find it here: minecraft/logs/kubejs/startup.txt
the ItemEvent is a server event....
nop
not that it matters a whole lot, I thought kjs was a lot stricter in where stuff was placed in kjs6 but I guess it still runs as it should from startup
that specific event within it, is startup
must've read it wrong
GROUP.startup("toolTierRegistry"
think it says server on the wiki
leme see
so what do you want me to do?
the repair ingredient does not work except for vanilla items it seems
cause when i replace it with diamond, it works to repair
dis please
okay! Ill boot up game and send
i have a feeling your item is being registered at a different time than when the tier is being registered
not sure how it works actually, which order
cuz items need the tier
and tiers need the item 
i tried putting the tier above the item and below, still wasnt working
that wont do anything
could add a console log to each event to see which fires first
what would the line be
console.log(string)
Paste version of new_items.js from @grand elk
Paste version of startup.txt from @rocky yew
sent
without the added console log
so you want me to add your "new_items.js" into my startup scripts?
we need to see the oen with console logs
well yes 
should i delete my own script?
i rewrote your file
okok ill do dthat
just rename it to like script.js.disabled
launching
ive been wondering forever how to disable files, its just adding .disabled at the end?
you can add anything that isnt .js
you can name it script.js.mybeautifulextensionthatnobodyhaseverusedbefore
and it will work
Paste version of startup.txt from @rocky yew
yeah so the tier is registered before your item is generated
you could try to make another file where you register that 1 item
and make it a high priority
to see if that affects it in any way
higher priority means loaded first?
but still, an item from another mod was not working either, so maybe loading the tier script as last priority over mods?
don't think that's going to change the firing order of the registry events
event.add('desh', tier => {
tier.uses = 2200
tier.speed = 8.0
tier.attackDamageBonus = 2.0
tier.level = 4
tier.enchantmentValue = 15
tier.repairIngredient = 'ad_astra:desh_ingot'
})
with this, even desh ingot wasnt working
you could do an item modification event, that should fire after the registries
that would be server scripts?
still startup
what would i write it as?
the event is in ye olde list of events
how would it looks from this snippet?
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_helmet', item => {
item.tier = tierOptions => {
repairIngredient = ('kubejs:void_worm_gu')
}
})
})
i tried following the wiki as best I could
pretty close, you're passing in tierOptions, so it would be tierOptions.repairIngredient = 'kubejs:void_worm_gu'
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_helmet', item => {
tierOptions.repairIngredient = 'kubejs:void_worm_gu'
})
})
like this?
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_helmet', item => {
item.tier = tierOptions => {
tierOptions.repairIngredient = 'kubejs:void_worm_gu'
}
})
})
si
imma try and see if it fixed it
if not, last thing to try is
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_helmet', item => {
item.setTier(tierOptions => {
tierOptions.repairIngredient = 'kubejs:void_worm_gu'
})
})
})
whats the difference with set?
so everything gets beaned, it's a way getters and setters get simplified.... but I'm never sure if they're working properly so sometimes I try the non beaned method lol
crashing on launch
it doesnt like:
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_helmet', item => {
item.tier = tierOptions => {
tierOptions.repairIngredient = 'kubejs:void_worm_gu'
}
})
})
try it with the sword and see if it works, I have a feeling I know what's going on
trying with
ItemEvents.modification(event => {
event.modify('kubejs:void_wormed_sword', item => {
item.tier = tierOptions => {
tierOptions.repairIngredient = 'kubejs:void_worm_gu'
}
})
})
it booted
loading world to see if it repairs it too
but with tool it worked, crashes with armor piece
first, you are making a separate armor tier for the armor pieces right? it doesn't take a tool tier
also it looks like modifying the tool in the item modification event is built around tools only
https://github.com/KubeJS-Mods/KubeJS/blob/1.19/main/common/src/main/java/dev/latvian/mods/kubejs/core/ItemKJS.java#L116
hmmmm, is there a way to maybe changing the "recipe" for anvil repairing for an item? through a server script, maybe that would work?
@rocky yew Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!
@rocky yew Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!
Still unable to get this to work as intended
