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

44 lines
1.1 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)
2022-09-17 21:03:54 +01:00
var i = 0
2022-08-20 16:53:11 +01:00
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)
2022-09-17 21:03:54 +01:00
var i = 0
2022-08-20 16:53:11 +01:00
for (i = 0; i < deepSlateLootTable.length; i++) {
pool.addItem(deepSlateLootTable[i],1).randomChance(deepSlateLootChance)
}
})
})
})