#custom tool tier not working

1 messages · Page 1 of 1 (latest)

rocky yew
#

what am i doing wrong?

    StartupEvents.registry('item.tool_tiers', 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    '
    })
})
hearty marshBOT
#

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

grand elk
#

maybe the whitespace in the repairIngredient?

#

youre not supposed to have whitespaces

rocky yew
#

is this correct though:

StartupEvents.registry('item.tool_tiers', event => {
rocky yew
grand elk
#

mmm probably not

#

i'll find it

rocky yew
#

the whitespace wasnt the issue, i just tested

rocky yew
deft grove
#

ItemEvents.toolTierRegistry

rocky yew
#

like that?

deft grove
#

just event

grand elk
#

no

#

ItemEvents.toolTierRegistry(event => {

#

if i dont write it, its not correct :P

rocky yew
#
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?

grand elk
#

yes

rocky yew
#

thanks! ill test it

deft grove
grand elk
#

imagine not using the command i made

deft grove
#

I would have to know what the command is no?

grand elk
#

/kjswiki uwu

deft grove
#

yeah, but see I don't use it for it to be a habit at this point lol

grand elk
#

well the use is that you dont have to write the message, just click a button thinking_lex

silent warrenBOT
#

This is a list of all the events. Choose your version.

rocky yew
#

why would it be that i cant use a repair item that i registered earlier in the code though ?

silent warrenBOT
#

Paste version of script.js from @rocky yew

rocky yew
#

not working :/

grand elk
silent warrenBOT
#

Paste version of new_items.js from @grand elk

grand elk
#

try this file instead of yours and when youre in the game send me the startup log

silent warrenBOT
#

Please send your startup.txt log file.
You can find it here: minecraft/logs/kubejs/startup.txt

deft grove
#

the ItemEvent is a server event....

grand elk
#

nop

deft grove
#

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

grand elk
#

that specific event within it, is startup

deft grove
#

must've read it wrong

grand elk
#

GROUP.startup("toolTierRegistry"

deft grove
#

think it says server on the wiki

grand elk
#

leme see

deft grove
#

nope it's right

#

my bad

grand elk
#

i was getting nervous now lol

rocky yew
#

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

rocky yew
# grand elk

but not with item added by kubjs, nor by other mods

rocky yew
#

okay! Ill boot up game and send

grand elk
#

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 hmmm

rocky yew
#

i tried putting the tier above the item and below, still wasnt working

deft grove
#

could add a console log to each event to see which fires first

rocky yew
#

what would the line be

deft grove
#

console.log(string)

grand elk
silent warrenBOT
#

Paste version of new_items.js from @grand elk

grand elk
#

load this file, then send the startup log ples

#

make sure you replace your file

rocky yew
silent warrenBOT
#

Paste version of startup.txt from @rocky yew

rocky yew
#

sent

#

without the added console log

#

so you want me to add your "new_items.js" into my startup scripts?

grand elk
#

we need to see the oen with console logs

rocky yew
#

should i delete my own script?

grand elk
#

i rewrote your file

rocky yew
#

okok ill do dthat

grand elk
#

just rename it to like script.js.disabled

rocky yew
#

launching

rocky yew
grand elk
#

you can add anything that isnt .js

#

you can name it script.js.mybeautifulextensionthatnobodyhaseverusedbefore

#

and it will work

rocky yew
#

foreal? that will automatically disable a file?

#

NOICE

silent warrenBOT
#

Paste version of startup.txt from @rocky yew

rocky yew
#

here you go

#

thats your script loaded in it

grand elk
#

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

rocky yew
#

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?

deft grove
#

don't think that's going to change the firing order of the registry events

rocky yew
#
    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

deft grove
#

you could do an item modification event, that should fire after the registries

rocky yew
#

that would be server scripts?

deft grove
#

still startup

rocky yew
#

what would i write it as?

deft grove
#

the event is in ye olde list of events

rocky yew
#

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')
      }
    })
  })
rocky yew
deft grove
#

pretty close, you're passing in tierOptions, so it would be tierOptions.repairIngredient = 'kubejs:void_worm_gu'

rocky yew
#

like this?

deft grove
#

no

#

go back the way you had it and only change the repair line

rocky yew
#
ItemEvents.modification(event => {
    event.modify('kubejs:void_wormed_helmet', item => {
      item.tier = tierOptions => {
        tierOptions.repairIngredient = 'kubejs:void_worm_gu'
      }
    })
  })
deft grove
#

si

rocky yew
#

imma try and see if it fixed it

deft grove
#

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'
    })
  })
})
rocky yew
#

whats the difference with set?

deft grove
#

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

rocky yew
#

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'
      }
    })
  })
deft grove
#

try it with the sword and see if it works, I have a feeling I know what's going on

rocky yew
rocky yew
#

loading world to see if it repairs it too

#

but with tool it worked, crashes with armor piece

deft grove
#

first, you are making a separate armor tier for the armor pieces right? it doesn't take a tool tier

rocky yew
#

the tool tier and armor tier are called the same

#

also, the repair isnt working

deft grove
rocky yew
#

hmmmm, is there a way to maybe changing the "recipe" for anvil repairing for an item? through a server script, maybe that would work?

hearty marshBOT
#

@rocky yew Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

hearty marshBOT
#

@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
#

Still unable to get this to work as intended