#armor crafting recipe change

81 messages · Page 1 of 1 (latest)

outer granite
#

What I am trying to do is create a custom crafting recipe for the wooden armor added by immersive armors, which follows the usual armor crafting routine. I want to replace the logs used with a different material, specifically the tough block of wood crafting material added by the mod tough beginnings. can somebody help me create a script to change the recipe? 1.21.1 neoforge if thats important

river crownBOT
#

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

main tulip
#

e.replaceInput()

#
event.replaceInput(
  { output: 'armor_item_id' }, // Arg 1: the filter
  'item_you_want_to_replace',            // Arg 2: the item to replace
  'item_to_replace_it_with'         // Arg 3: the item to replace it with
)
#
ServerEvents.recipes(event=>{
    const types = [`chestplate`, `leggings`, `helmet`, `boots`]
    types.forEach(types=>{
        event.replaceInput(
        { output: `namespace:wooden_${types}` }, // Arg 1: the filter
        'item_you_want_to_replace',            // Arg 2: the item to replace
        'item_to_replace_it_with'         // Arg 3: the item to replace it with
        )
    })
})

will replace the all items with
namespace:wooden_xyz
so
namespace:wooden_chestplate
namespace:wooden_leggings
namespace:wooden_helmet
and
namespace:wooden_boots

outer granite
main tulip
#

they're the same thing done 2 different ways

outer granite
#

oh ok

main tulip
#

i recomend the second one

#

it keeps code cleaner

#

if you hold the armor piece in your hand and do
/kjs hand
you can get the item id

outer granite
#

the item id for kube js hand command just says immersieve_armors:immersive_armors, can i use that?

main tulip
#

uh hm

#

thats not a normal output

#

nomally youd get
"immersieve_armors:wooden_chestplate" or whatever

outer granite
#

i thought so lol i will use that

main tulip
#

idk what immersive armor has
itll error

#

immersive armor probably uses data driven armor

outer granite
#

also the crafting recipe uses all blocks tagged as logs, would I want to use #minecraft:logs as the thing i want to replace?

main tulip
#

immersive_armor:oak_helmet

#
ServerEvents.recipes(event=>{
    const types = [`chestplate`, `leggings`, `helmet`, `boots`]
    types.forEach(types=>{
        event.replaceInput(
        { output: `immersive_armor:oak_${types}` }, // Arg 1: the filter
        '#minecraft:logs',            // Arg 2: the item to replace
        'item_to_replace_it_with'         // Arg 3: the item to replace it with
        )
    })
})```
#

should be in server scripts

#

then /reload

#

oh but thats the old version of the mod idk about the new one

outer granite
#

ok tried both and they dont work

#

heres my second one, does it look right>

main tulip
#

is there an error?

outer granite
#

visual studio isn't telling me anything, is there a way to check for errors? I am very very new and inexperienced when it comes to modding and using visual studio

main tulip
#

lol

#

what launcher do you use

outer granite
#

curseforge launcher

#

do u want me to send the latest.log?

main tulip
#

yes

outer granite
shell flareBOT
#

Paste version of mclo.gs/eFsX56D from @outer granite

main tulip
#

well kjs didnt give error

#

give me a min

outer granite
#

fs thx for the help

main tulip
#

yeah

#

-# honestly the kjs sever is like the one development server where the community doesnt expect you to know everything -- and are polite

#
ServerEvents.recipes(event=>{
    event.replaceInput(
    { output: `minecraft:crafting_table` }, // Arg 1: the filter
    '#minecraft:planks',            // Arg 2: the item to replace
    'minecraft:dirt'         // Arg 3: the item to replace it with
    )
})

works for me

#

its probably the itemId of the armor

#

you dont get an output like this?

#

with /kjs hand

outer granite
main tulip
#

immersive_armors:wooden_boots

#
ServerEvents.recipes(event=>{
    const types = [`chestplate`, `leggings`, `helmet`, `boots`]
    types.forEach(types=>{
        event.replaceInput(
        { output: `immersive_armors:wooden_${types}` }, // Arg 1: the filter
        '#minecraft:logs',            // Arg 2: the item to replace
        'item_to_replace_it_with'         // Arg 3: the item to replace it with
        )
    })
})
main tulip
outer granite
#

i tried, and so far no. im gonna do a quick test instance with just the required mods to see if its from a mod conflict

main tulip
#

shouldnt be but its possible

outer granite
#

ive had an issue before with kubejs being overwritten by mod configs

main tulip
#

hm

#

ig if they replace recipes that could cause it

outer granite
#

ok just tested it on a instance with only the needed mods and that didn't work there either

#

in the server script, should there be a comma after 'item_to_replace_it_with'

main tulip
#

no cause its the last one

#

in jei could you hover over the logs tag in the recipe? is it '#minecraft:logs' or is it a custom tag

outer granite
#

it just says #minecraft:logs, but this also includes logs from other terrain gen mods like biomes o plenty if that helps

main tulip
#

yeah cause most mods will add their logs to the tag so other mods can use them without spesific compatibility

outer granite
#

nvm it just worked

main tulip
#

oh

#

nice!

outer granite
#

i relaunched it and idk what changed but it worked

main tulip
#

sometimes restarting works

#

??closeticket

#

??closeticket

shell flareBOT
# main tulip ??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 create a new post for unrelated issues.

outer granite
#

future speaking, if i wanted to alter the crafting grid recipe for items, what script would i use to map that out? like not just replacing all materials but specific ones in recipes?

main tulip
#

for single ones

ServerEvents.recipes(event=>{
        event.replaceInput(
        { output: `output` }, // Arg 1: the filter
        'replace',            // Arg 2: the item to replace
        'replace_with'         // Arg 3: the item to replace it with
        )
})```
#

(like recipes that dont have variants like helmet leggings chestplate and boots)

outer granite
#

say i wanted to replace a recipe that uses 2 iron ingots to one that has 1 netherite ingot and one iron ingot, how would I do that?

main tulip
#

youd remove the recipe and make a new one

#

cause its not the same shape

outer granite
#

ok i see, where would i find the scripts for those?

#

r they on the wiki?

main tulip
#

if you have more questions