#hey im back alssooo the recipe stuff gets triggered twice :p
26 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
ServerEvents.recipes(event => {
let workbenches = [
['minecraft:stone_hoe', 'workers:farmer_block'],
['minecraft:stone_axe', 'workers:lumberjack_block'],
['minecraft:stone_pickaxe', 'workers:miner_block'],
['minecraft:fishing_rod', 'workers:fisherman_block'],
['minecraft:shears', 'workers:shepherd_block'],
['minecraft:milk_bucket', 'workers:cattle_farmer_block'],
['minecraft:paper', 'workers:merchant_block'],
['minecraft:egg', 'workers:chicken_farmer_block'],
['minecraft:porkchop', 'workers:swineherd_block'],
['minecraft:stone_sword', 'recruits:recruit_block'],
['minecraft:shield', 'recruits:recruit_shield_block', ],
['minecraft:crossbow', 'recruits:crossbowman_block'],
['minecraft:bow', 'recruits:bowman_block'],
['minecraft:saddle', 'recruits:horseman_block'],
//special cases
['recruits:bowman_block', 'minecraft:saddle', 'recruits:nomad_block'],
['recruits:horseman_block', 'minecraft:bow', 'recruits:nomad_block']]
let deploying = (inputs, output) => {
event.custom({
type: 'create:deploying',
ingredients: inputs.map(input => Ingredient.of(input).toJson()),
results: [Item.of(output).toJson()],
})
}
let itemApplication = (inputs, output) => {
event.custom({
type: 'create:item_application',
ingredients: inputs.map(input => Ingredient.of(input).toJson()),
results: [Item.of(output).toJson()],
})
}
workbenches.forEach(workbench => {
console.log(workbench + " - " + workbench.length)
if(workbench.length > 2) {
deploying([workbench[0], workbench[1]], workbench[2])
itemApplication([workbench[0], workbench[1]], workbench[2])
} else {
deploying(['create:andesite_casing', workbench[0]], workbench[1])
itemApplication(['create:andesite_casing', workbench[0]], workbench[1])
}
})
})
log output:
[22:48:36] [INFO] example.js#45: minecraft:stone_hoe,workers:farmer_block - 2
[22:48:36] [INFO] example.js#45: minecraft:stone_axe,workers:lumberjack_block - 2
[22:48:36] [INFO] example.js#45: minecraft:stone_pickaxe,workers:miner_block - 2
[22:48:36] [INFO] example.js#45: minecraft:fishing_rod,workers:fisherman_block - 2
[22:48:36] [INFO] example.js#45: minecraft:shears,workers:shepherd_block - 2
[22:48:36] [INFO] example.js#45: minecraft:milk_bucket,workers:cattle_farmer_block - 2
[22:48:36] [INFO] example.js#45: minecraft:paper,workers:merchant_block - 2
[22:48:36] [INFO] example.js#45: minecraft:egg,workers:chicken_farmer_block - 2
[22:48:36] [INFO] example.js#45: minecraft:porkchop,workers:swineherd_block - 2
[22:48:36] [INFO] example.js#45: minecraft:stone_sword,recruits:recruit_block - 2
[22:48:36] [INFO] example.js#45: minecraft:shield,recruits:recruit_shield_block - 2
[22:48:36] [INFO] example.js#45: minecraft:crossbow,recruits:crossbowman_block - 2
[22:48:36] [INFO] example.js#45: minecraft:bow,recruits:bowman_block - 2
[22:48:36] [INFO] example.js#45: minecraft:saddle,recruits:horseman_block - 2
[22:48:36] [INFO] example.js#45: recruits:bowman_block,minecraft:saddle,recruits:nomad_block - 3
[22:48:36] [INFO] example.js#45: recruits:horseman_block,minecraft:bow,recruits:nomad_block - 3
emi xd
they different recipe typess
basically 1 ismanual and the other is automated
hm look like manual item application recipes only get created once
xd for whatever reaon
@wide mantle does EMI give you a way to get the recipe ID?
hmmm maybe let me look for a debug option
o.O
could it be it auto generates deploying rcipess?
certainly
xdd yepppppp thats it
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.
