ultron/.minecraft/kubejs/server_scripts/ultron-loot.js

60 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-08-20 16:53:11 +01:00
// Custom Loot Tables
onEvent('block.loot_tables', event => {
event.addBlock('minecraft:cobblestone', table => {
table.addPool(pool => {
pool.addItem('minecraft:coal', 1).randomChance(0.3)
pool.addItem('minecraft:cobblestone', 1)
})
})
// stone loot table
// default, 0.02, 2%
const stoneLootChance = 0.02
const stoneLootTable = [
"minecraft:redstone",
"minecraft:raw_iron",
"minecraft:raw_gold",
"minecraft:lapis_lazuli",
]
event.addBlock('minecraft:stone', table => {
table.addPool(pool => {
pool.addItem('minecraft:cobblestone', 1)
for (i = 0; i < stoneLootTable.length; i++) {
pool.addItem(stoneLootTable[i],1).randomChance(stoneLootChance)
}
})
})
const deepSlateLootChance = 0.02
const deepSlateLootTable = [
"minecraft:tuff",
]
event.addBlock('minecraft:deepslate', table => {
table.addPool(pool => {
pool.addItem('minecraft:cobbled_deepslate', 1)
for (i = 0; i < deepSlateLootTable.length; i++) {
pool.addItem(deepSlateLootTable[i],1).randomChance(deepSlateLootChance)
}
})
})
})
onEvent('recipes', event => {
// Allium Entangled Modem
event.shaped('1x allium_peripherals:entangled_modem', [
'O O',
'ECE',
'MPM'
], {
O: 'minecraft:obsidian',
E: 'computercraft:wireless_modem_advanced',
C: 'minecraft:ender_chest',
M: 'computercraft:wired_modem',
P: 'minecraft:ender_eye'
})
})