#Ingots into gear (thermal press)
265 messages · Page 1 of 1 (latest)
ups sry for pic spam mb
What's the issue/
its not working
how's it not working? You haven't shared an error, log, expected and real outcome
Im having some issues with it. Could u help me out pls?`
ServerEvents.recipes(event => {
let ResourceTypes = [
`compressed_iron`,
`dark_steel`,
`energetic_alloy`,
`vibrant_alloy`,
`unobtainium`,
`vibranium`,
`allthemodium`,
`brass`,
`zinc`,
`uranium`,
`platinum`,
`osmium`,
`iridium`,
`aluminum`,
]
ResourceTypes.forEach(material => {
let ingotTag = Ingredient.of(`#forge:ingots/${material}`)
event.custom({
type: `thermal:press`,
ingredients: [
ingotTag.withCount(4).toJson(),
Ingredient.of(`thermal:press_gear_die`).toJson(),
],
result: [#forge:${material}_gear.toJson()],
}).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`)
})
})
wtf
1 sec
there is no error only warnings
Paste version of message.txt from @red smelt
Duplicate recipe for id
ye but there are no recipes
something went wrong with the script
there were none befor the script
could u help me fix it, please?
Where did that code come from?
my friend and i did it
hmmm maybe thats the error
damn
ServerEvents.recipes(event => {
let ResourceTypes = [
compressed_iron,
dark_steel,
energetic_alloy,
vibrant_alloy,
unobtainium,
vibranium,
allthemodium,
brass,
zinc,
uranium,
platinum,
osmium,
iridium,
aluminum,
];
ResourceTypes.forEach(material => {
let ingotTag = Ingredient.of(`#forge:ingots/${material}`);
event.custom({
type: "thermal:press",
ingredients: [
ingotTag.withCount(4).toJson(),
Ingredient.of("thermal:press_gear_die").toJson(),
],
result: [Item.of(`${material}_gear`).toJson()],
}).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`);
});
});```
But cleaner and no syntax errors
Paste version of message.txt from @red smelt
Like I said, untested, just cleaned up your code. Variables aren't usually handled like that which is why I asked where you got this code from?
If you wish to use the ${variable} replace the double quotes with a backtic
` vs "
A friend of mine and i did it together
he sended me the file and told me to fill it up with the name of the items
Otherwise you can do "Text " + variable
- is used in javascript to concat two strings, variables or both
which ones?
iam not that good in scripting
noob friendlier pls :C
That is noob friendly
There, updated
${variable} works for inlining variables in text strings but has to be wrapped with a ` backtick
oh, okay ty
Did it work?
You can just /reload
Paste version of message.txt from @red smelt
no errors only warnings
ye had to restart anyways
No
Paste this in and /reload
ServerEvents.recipes(event => {
let ResourceTypes = [
"compressed_iron",
"dark_steel",
"energetic_alloy",
"vibrant_alloy",
"unobtainium",
"vibranium",
"allthemodium",
"brass",
"zinc",
"uranium",
"platinum",
"osmium",
"iridium",
"aluminum",
];
ResourceTypes.forEach(material => {
event.custom({
type: "thermal:press",
ingredients: [
Ingredient.of(`#forge:ingots/${material}`, 4).toJson(),
Item.of("thermal:press_gear_die").toJson(),
],
result: [Item.of(`${material}_gear`).toJson()],
}).id(`kubejs:thermal/machines/press/press_${material}_ingot_to_gear`);
});
});```
testing
What mods are providing the ingots?
alltheores
pneumaticcraft = compressed iron
Enderio = dark stee, vibrant alloy and energetic alloy
Ok
rest alltheores
So you can't call an Item.of('dark_steel_gear');
Kubejs has no idea what mod that is from
it has to be Item.of('enderio:dark_steel_gear');
So you need to be specific about items
Ingredients are tags, so #forge:ingots/dark_steel works because anything that's tagged with that tag will work as an ingredient but not an output or result
hmmmm
Make sense?
yess
yes
for compressed_iron
compressed iron
yep
no
i used the tag for it
but there is no alltheores thing for it
yeah great, but what about the gear?
its from pneumaticcraft
I'll give you an example for a couple of items and you can figure out the rest
{
"type": "thermal:press",
"ingredients": [
{
"tag": "forge:ingots/gold",
"count": 4
},
{
"item": "thermal:press_gear_die"
}
],
"result": [
{
"item": "thermal:gold_gear"
}
]
}
cant i just override the data and use it as a datapack in kubejs?
by changing gold into $(material)?
hold on
[18:01:06] [WARN] Error parsing recipe kubejs:thermal/machines/press/press_quartz_ingot_to_gear[thermal:press]: {"type":"thermal:press","ingredients":[{"count":4,"ingredient":{"tag":"forge:ingots/quartz"}},{"item":"thermal:press_gear_die","count":1}],"result":{"item":"minecraft:air","count":0}}: com.google.gson.JsonSyntaxException: Invalid Thermal Series recipe: kubejs:thermal/machines/press/press_quartz_ingot_to_gear
Refer to the recipe's ResourceLocation to find the mod responsible and let them know!
this error appears
thats what u meant i guess
Yep, it will convert to air as the output if invalid
okay okay i got it
let me see if I can fix this up for you, give me a few minutes
ServerEvents.recipes(event => {
let ResourceTypes = [
`unobtainium`,
`vibranium`,
`allthemodium`,
`brass`,
`zinc`,
`uranium`,
`platinum`,
`osmium`,
`iridium`,
`aluminum`,
]
ResourceTypes.forEach(ato => {
event.custom({
type: "thermal:press",
ingredients: [
Ingredient.of(`#forge:ingots/${ato}`, 4).toJson(),
Item.of("thermal:press_gear_die").toJson(),
],
result: Item.of(`alltheores:${ato}_gear`).toJson(),
}).id(`kubejs:thermal/machines/press/press_${ato}_ingot_to_gear`);
})
let Enderio = [
`dark_steel`,
`energetic_alloy`,
`vibrant_alloy`,
]
Enderio.forEach(eio => {
event.custom({
type: "thermal:press",
ingredients: [
Ingredient.of(`#forge:ingots/${eio}`, 4).toJson(),
Item.of("thermal:press_gear_die").toJson(),
],
result: Item.of(`alltheores:${eio}_gear`).toJson(),
}).id(`kubejs:thermal/machines/press/press_${eio}_ingot_to_gear`);
event.custom({
type: "thermal:press",
ingredients: [
Ingredient.of(`#forge:ingots/compressed_iron`, 4).toJson(),
Item.of("thermal:press_gear_die").toJson(),
],
result: Item.of(`alltheores:compressed_iron,_gear`).toJson(),
}).id(`kubejs:thermal/machines/press/press_compressed_iron,_ingot_to_gear`);
})
})
it should be working like this no?
kk
Do you have the enderio metals tagged as #forge:ingots/XXX ?
ok
and compressed_iron?
also tagged that way and alltheores:compressed_iron_gear exists?
Paste version of message.txt from @red smelt
?
hold on
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({output: output});
event.custom({
type: "thermal:press",
ingredient: [
Ingredient.of(input, 4),
Item.of('thermal:press_gear_die')
],
result: [Item.of(output)],
}).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
};
makeGear('#forge:ingots/iron','alltheores:iron_gear', 'iron');
});
Try this for me. It works for me in 1.20.1 but fails in 1.19.2
it will remove it
kk
it's only a test
I'll know in a min, testing myself
Fails for me
works in a different pack, WTF
makeGear('forge:ingots/iron','alltheores:iron_gear', 'iron');
``` Should work
You can see where I'm going with this
i guess
lol
i just put in this line the names right?
like forge:ingots/osmium, alltheores:osmium_gear, osmium
yeah, it's empty
yep
got it
yeyyy
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({ output: output });
event.custom({
type: "thermal:press",
ingredient: [
input,
Item.of('thermal:press_gear_die')
],
result: [output],
}).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
};
let allTheMetals = [
'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
];
allTheMetals.forEach(material => {
makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
});
// 'dark_steel', 'energetic_alloy', 'vibrant_alloy'
});```
Still need to do the Enderio and Pneumaticcraft ones
Make sure it works before you stroke my ego 😛
You can apply the same logic to the EnderIO ones but the default recipes are more complex than 4 ingots to a gear
testing
alltheores doesn't have enderio gears FYI
sweet
ty very much for taking so much time!
For those, I would do them manually.
makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');
Do the same for EnderIO but replace the item names
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({ output: output });
event.custom({
type: "thermal:press",
ingredient: [
input,
Item.of('thermal:press_gear_die')
],
result: [output],
}).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
};
// All The Ores / Vanilla
let allTheMetals = [
'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
];
allTheMetals.forEach(material => {
makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
});
// Pneumaticcraft
makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');
// EnderIO
makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energetic_alloy');
makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant_alloy');
});```
Final
Assuming pneumaticcraft:compressed_iron_gear is valid
I have no idea without adding it to my test env
You can remove iron from the allTheMetals array if you don't want the new recipe
kk
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 generally should create a new post for unrelated issues.
Ticket closed!
yooo eh xD
could u help me to the same with immersive metal press? :c
You can do it, I know you can
i am just going to use the same script but kinda failed by the "type"
{
"type": "immersiveengineering:metal_press",
"conditions": [
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:gears/aluminum"
}
}
],
"energy": 2400,
"input": {
"base_ingredient": {
"tag": "forge:ingots/aluminum"
},
"count": 4
},
"mold": "immersiveengineering:mold_gear",
"result": {
"tag": "forge:gears/aluminum"
}
}```
ty!
thats more then enough
Try it and if you get errors, I'll help you
ty!
Surprisingly easy
Enderio will be different because of item names
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({ output: output });
event.custom({
type: "immersiveengineering:metal_press",
mold: `immersiveengineering:mold_gear`,
result: [output],
}).id('immersiveengineering:metalpress/gear_' + material);
};
// All The Ores / Vanilla
let allTheMetals = [
'dark_steel', 'energetic_alloy', 'vibrant_alloy'
];
allTheMetals.forEach(material => {
makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('enderio:' + material + '_gear'), material);
});
})
cant test it out atm server wont let me in
restarting it
Ok wait, you don't want to redefine the same function, just add to it
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({ output: output });
event.custom({
type: "thermal:press",
ingredient: [
input,
Item.of('thermal:press_gear_die')
],
result: [output],
}).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
event.custom({
"type": "immersiveengineering:metal_press",
"conditions": [
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:gears/" + material
}
}
],
"energy": 2400,
"input": {
"base_ingredient": {
"tag": "forge:ingots/" + material
},
"count": 4
},
"mold": "immersiveengineering:mold_gear",
"result": output.toJson()
}).id('kubejs:immersiveengineering/press/press_' + material + '_ingot_to_gear');
};
// All The Ores / Vanilla
let allTheMetals = [
'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
];
allTheMetals.forEach(material => {
makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
});
// Pneumaticcraft
makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');
// EnderIO
makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energetic_alloy');
makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant_alloy');
});```
Doesn't do IE press for energetic or vibrant gear, also not sure about PNC compressed
its another file
The problem is the event.remove for the recipe output
you'll have a conflict eventually
this is better, make one function that creates gears
kk
do u know why this happens ?
i cant even kick my self out if i have this screen
dark steel works, but vibrant and energetic alloy doenst
weird
they don't because their tag name is different
I'll look into it, also sucks the way the IE recipe differs from Thermal
Any other pressing recipes you need before I change things up?
allthemodium onces
i did them for the servo press
but could need help for metal press
So the Thermal and IE press? No Create Press or anything else?
methods of pressing, not items to press
minecraft:quartz -> thermal:gear
and
redstone_aresenal:flux_ingot ->redstone:arsenal:flux_gear
would be nice too actually
would appreciate it
Thermal IE and Create would be great
Not sure how Create would work actually for a gear
but here's Thermal and IE:
ServerEvents.tags('item', event => {
event.get('forge:ingots/energized').add('#forge:ingots/energetic_alloy');
event.get('forge:ingots/vibrant').add('#forge:ingots/vibrant_alloy');
});
ServerEvents.recipes(event => {
let makeGear = (input, output, material) => {
event.remove({ output: output });
event.custom({
type: "thermal:press",
ingredient: [
input,
Item.of('thermal:press_gear_die')
],
result: [output],
}).id('kubejs:thermal/machines/press/press_' + material + '_ingot_to_gear');
event.custom({
"type": "immersiveengineering:metal_press",
"conditions": [
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:gears/" + material
}
}
],
"energy": 2400,
"input": {
"base_ingredient": {
"tag": "forge:ingots/" + material
},
"count": 4
},
"mold": "immersiveengineering:mold_gear",
"result": output.toJson()
}).id('kubejs:immersiveengineering/press/press_' + material + '_ingot_to_gear');
};
// All The Ores / Vanilla
let allTheMetals = [
'aluminum', 'iridium', 'lead', 'nickel', 'osmium', 'platinum', 'silver', 'tin',
'uranium', 'zinc', 'steel', 'invar', 'electrum', 'bronze', 'enderium', 'lumium',
'signalum', 'constantan', 'brass', 'iron', 'gold', 'copper'
];
allTheMetals.forEach(material => {
makeGear(Item.of("#forge:ingots/" + material).withCount(4), Item.of('alltheores:' + material + '_gear'), material);
});
// Pneumaticcraft
makeGear(Item.of('pneumaticcraft:compressed_iron_ingot').withCount(4), Item.of('pneumaticcraft:compressed_iron_gear'), 'compressed_iron');
// EnderIO
makeGear(Item.of('enderio:dark_steel_ingot').withCount(4), Item.of('enderio:dark_bimetal_gear'), 'dark_steel');
makeGear(Item.of('enderio:energetic_alloy_ingot').withCount(4), Item.of('enderio:energized_gear'), 'energized');
makeGear(Item.of('enderio:vibrant_alloy_ingot').withCount(4), Item.of('enderio:vibrant_gear'), 'vibrant');
});```
ty testing it
That sets a new tag for EnderIO ingots to simplify these recipes
very smart
Allthemodium, vibranium and unobtainium, are only working on the thermal press
not on IE
i added them right under enderio
// Allthemodium
makeGear(Item.of('allthemodium:allthemodium_ingot').withCount(4), Item.of('allthemodium:allthemodium_gear'), 'allthemodium_ingot');
makeGear(Item.of('allthemodium:vibranium_ingot').withCount(4), Item.of('allthemodium:vibranium_gear'), 'vibranium_ingot');
makeGear(Item.of('allthemodium:unobtainium_ingot').withCount(4), Item.of('allthemodium:unobtainium_gear'), 'unobtainium_ingot');
just copy paste the enderio thing but change it with allthemodium?
no
😦
not necessarily
The tag has to work for it
I didn't install allthemodium, hold on
kk
// All The Modium
makeGear(Item.of('allthemodium:allthemodium_ingot').withCount(4), Item.of('allthemodium:allthemodium_gear'), 'allthemodium');
makeGear(Item.of('allthemodium:unobtainium_ingot').withCount(4), Item.of('allthemodium:unobtainium_gear'), 'unobtainium');
makeGear(Item.of('allthemodium:vibranium_ingot').withCount(4), Item.of('allthemodium:vibranium_gear'), 'vibranium');```
so yeah, I guess it was similar
I just didn't have the mod installed
ty testing!
well that was fun
this error appears everytime
have to restart it a few times
Could be anything, try doing dev on a single player world
dev on a server is just torture
Ticket closed!
