#Custom tools wont accept new repair ingredient

59 messages · Page 1 of 1 (latest)

oblique coral
whole onyxBOT
#

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

oblique coral
#

I couldn't really find something on the wiki..

#

About this at least

oblique coral
#

what?

nocturne vine
#

anyways uh, replace repairIngredient with item.repairIngredient

oblique coral
#

Okay im launcing mc

#

This error shows

dry nest
#

??sendcode

summer tangleBOT
# dry nest ??sendcode

Send your code here instead of a screenshot

It makes it easier to diagnose your code and help you fix it or make the required changes/additions.

oblique coral
summer tangleBOT
#

Paste version of modifications.js from @oblique coral

dry nest
#

instead of item modification try modifying the tier on startup

StartupEvents.registry("item", event => {
    event.create("test", "sword")
        .maxDamage(15)
        .modifyTier(tier => {
            tier.setRepairIngredient(Ingredient.of("minecraft:copper_ingot"))
        })
})```
white lance
#

isn't repairIngredient from the tier

oblique coral
#

yeah I think

oblique coral
#

So like Ingredient repairIngredient = () ?

dry nest
#

no

#

this in your tool builder js .modifyTier(tier => { tier.setRepairIngredient(Ingredient.of("minecraft:copper_ingot")) })

#

not the item modification event

oblique coral
#

So this goes in the tool registry?

dry nest
#

yup

#

wherever it is you're registering them

oblique coral
#

okk I'll try this rn

#

I'm guessing this must be included inside the }) of the registrered tools?

dry nest
#

send me one of your tool registry scripts

#

ill show you where it goes

oblique coral
#

okay

summer tangleBOT
#

Paste version of custom_tools.js from @oblique coral

dry nest
#

like you would the other variables js StartupEvents.registry('item', event => { event.create('charged_copper_forged_scythe', 'sword') .tier('diamond') .attackDamageBaseline(14.0) .maxStackSize(1) .glow(true) .displayName('Charged Copper Forged Scythe') .modifyTier(tier => { tier.setRepairIngredient(Ingredient.of("minecraft:copper_ingot")) }) event.create('charged_copper_forged_pickaxe', 'pickaxe').tier('diamond').maxStackSize(1).glow(true).displayName('Charged Copper Forged Pickaxe') event.create('charged_copper_forged_axe', 'axe').tier('diamond').maxStackSize(1).glow(true).displayName('Charged Copper Forged Axe') event.create('charged_copper_forged_shovel', 'shovel').tier('diamond').maxStackSize(1).glow(true).displayName('Charged Copper Forged Shovel') })

oblique coral
#

ohhh okay

#

I'll make this rn thanks so much!!

dry nest
#

yup!

oblique coral
#

So basically this part for every tool

dry nest
#

yup

oblique coral
#

Although I dont get any errors

#

It doesn seem to work

dry nest
oblique coral
#

I can just wing it and let it just use diamonds?

dry nest
#

lemme test something

oblique coral
#

okk

dry nest
# oblique coral okk

do this js .modifyTier(tier => { tier.setLevel(3) tier.setUses(1561) tier.setSpeed(8) tier.setAttackDamageBonus(3) tier.setEnchantmentValue(10) tier.setRepairIngredient(Ingredient.custom(item => { if (item.id == "kubejs:copper_forged_alloy") return true; return false; })) })

#

for whatever reason its not detecting the forged alloy with Ingredient.of() on startup probably because its a custom item and the event registry orde r is random with kjs

oblique coral
#

okay I'll give it a try rn

dry nest
#

kk

#

i removedthe diamond tier line just to manually impliment the diamond tier myself and i can confirm it works without it so if this doesnt work for you then just remove this line here js .tier('diamond')

oblique coral
#

ok thnx

#

Yeap it works!!!!!!

#

Thanks so much!

dry nest
#

np

#

??closeticket

summer tangleBOT
# dry nest ??closeticket

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 generally create a new post for unrelated issues.

whole onyxBOT
#

Ticket closed!

sweet portal
dry nest