add kubejs scripts
This commit is contained in:
parent
9767a38035
commit
74d4b0dccd
4 changed files with 104 additions and 1 deletions
50
.minecraft/kubejs/server_scripts/blacklist.js
Normal file
50
.minecraft/kubejs/server_scripts/blacklist.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
const itemBlacklist = [
|
||||
"allium_peripherals:chat_modem_creative"
|
||||
]
|
||||
|
||||
// remove recipes
|
||||
onEvent('recipes', event => {
|
||||
itemBlacklist.forEach(item => {
|
||||
event.remove({output: item})
|
||||
})
|
||||
});
|
||||
|
||||
// handle items
|
||||
onEvent('item.pickup', event => {
|
||||
if (itemBlacklist.includes(event.item.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
|
||||
});
|
||||
onEvent('item.toss', event => {
|
||||
if (itemBlacklist.includes(event.item.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
||||
onEvent('item.right_click', event => {
|
||||
if (itemBlacklist.includes(event.item.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
||||
|
||||
// handle blocks
|
||||
onEvent('block.place', event => {
|
||||
if (itemBlacklist.includes(event.block.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
||||
onEvent('block.break', event => {
|
||||
if (itemBlacklist.includes(event.block.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
||||
onEvent('block.right_click', event => {
|
||||
if (itemBlacklist.includes(event.block.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
||||
onEvent('block.left_click', event => {
|
||||
if (itemBlacklist.includes(event.block.id)) {
|
||||
event.cancel();
|
||||
};
|
||||
});
|
45
.minecraft/kubejs/server_scripts/loot-table.js
Normal file
45
.minecraft/kubejs/server_scripts/loot-table.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
|
||||
// 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)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue