forgotten-fronteir/.minecraft/kubejs/server_scripts/loot-table.js
2023-04-15 00:54:31 -07:00

45 lines
No EOL
1.8 KiB
JavaScript

// 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
event.addBlock('minecraft:stone', table => {
table.addPool(pool => {
pool.addItem('minecraft:cobblestone', 1)
// add stone ores to loot table with a 0.005 chance
pool.addItem('minecraft:iron_ore', 1).randomChance(0.005)
pool.addItem('minecraft:gold_ore', 1).randomChance(0.005)
pool.addItem('minecraft:copper_ore', 1).randomChance(0.005)
pool.addItem('minecraft:diamond_ore', 1).randomChance(0.005)
pool.addItem('minecraft:emerald_ore', 1).randomChance(0.005)
pool.addItem('minecraft:lapis_ore', 1).randomChance(0.005)
pool.addItem('minecraft:redstone_ore', 1).randomChance(0.005)
pool.addItem('minecraft:coal_ore', 1).randomChance(0.005)
})
})
event.addBlock('minecraft:deepslate', table => {
table.addPool(pool => {
pool.addItem('minecraft:cobbled_deepslate', 1)
// add tuff to loot table
pool.addItem('minecraft:tuff', 1).randomChance(0.02)
// add deepslate ores to loot table with a 0.005 chance
pool.addItem('minecraft:deepslate_iron_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_gold_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_copper_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_diamond_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_emerald_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_lapis_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_redstone_ore', 1).randomChance(0.005)
pool.addItem('minecraft:deepslate_coal_ore', 1).randomChance(0.005)
})
})
})