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
#armor crafting recipe change
81 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
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
these both go into the same server script?
they're the same thing done 2 different ways
oh ok
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
the item id for kube js hand command just says immersieve_armors:immersive_armors, can i use that?
uh hm
thats not a normal output
nomally youd get
"immersieve_armors:wooden_chestplate" or whatever
i thought so lol i will use that
idk what immersive armor has
itll error
immersive armor probably uses data driven armor
also the crafting recipe uses all blocks tagged as logs, would I want to use #minecraft:logs as the thing i want to replace?
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
is there an error?
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
yes
Paste version of mclo.gs/eFsX56D from @outer granite
fs thx for the help
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
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
)
})
})
@outer granite does this work?
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
shouldnt be but its possible
ive had an issue before with kubejs being overwritten by mod configs
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'
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
it just says #minecraft:logs, but this also includes logs from other terrain gen mods like biomes o plenty if that helps
yeah cause most mods will add their logs to the tag so other mods can use them without spesific compatibility
nvm it just worked
i relaunched it and idk what changed but it worked
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.
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?
Ticket closed!
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)
for multiple this one
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?