skapa-season-3/kubejs/server_scripts/create_cutting_planks.js
Steve McMaster fdce87ac75
All checks were successful
continuous-integration/drone/push Build is passing
Import KubeJS and Almost Unified
2024-07-12 00:30:16 +00:00

26 lines
962 B
JavaScript

if (Platform.isLoaded('create')) {
ServerEvents.recipes(event => {
Ingredient.of('#minecraft:planks').itemIds.forEach((plank_item) => {
let slab_item = plank_item.replace('_planks', '_slab')
if (Item.exists(slab_item)) {
let plank_item_name = plank_item.split(':')[1]
let slab_item_name = slab_item.split(':')[1]
console.log(plank_item + ' to ' + slab_item)
event.custom({
"type": "create:cutting",
"ingredients": [
plank_item
],
"results": [
{
"item": slab_item,
"count": 2
}
],
"processingTime": 50
}).id('create:' + slab_item_name + '_from_' + plank_item_name)
}
})
})
}