skapa-season-3/kubejs/server_scripts/create_cutting_planks.js
Steve McMaster 991442ea01
All checks were successful
continuous-integration/drone/push Build is passing
Bugfixes! Especially for quests, but also hordes (hopefully). UPDATE REQUIRED.
2024-07-13 00:13:26 +00:00

36 lines
1.4 KiB
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
let slab_item_name = slab_item.split(':')[1]
if (plank_item.startswith('minecraft:')) {
plank_item_name = plank_item.split(':')[1]
} else {
plank_item_name = plank_item.replace(':', '_')
}
if (slab_item.startswith('minecraft:')) {
slab_item_name = slab_item.split(':')[1]
} else {
slab_item_name = slab_item.replace(':', '_')
}
console.log(plank_item_name + '(' + plank_item + ') to ' + slab_item_name + '(' + 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)
}
})
})
}