add default scripts

This commit is contained in:
Merith-TK 2022-08-20 08:53:11 -07:00
parent 640ac5161f
commit 15a01b4ddc
5 changed files with 131 additions and 1 deletions

View file

@ -8,6 +8,18 @@ hash = "d421fe1943b6861fa0ac0a03f3996ab5f640d3b2086b6c2e1d8267e0f20ea43f"
file = "kubejs/config/packicon.png"
hash = "a1236cdbaa489a83438be848304413294772aeafe94dc17a1e09362c3277ba78"
[[files]]
file = "kubejs/server_scripts/ultron-blacklist.js"
hash = "849a2e3d58cdc3acddbe345ebfaa2c4668b31f1e0c4ed9cbc52d4182786a5825"
[[files]]
file = "kubejs/server_scripts/ultron-loot.js"
hash = "9bb0bb8661c184b86f2335b97bad6338d3dbf70e022a42c2b6fdf0513104f19d"
[[files]]
file = "kubejs/server_scripts/ultron-recipie.js"
hash = "ad068215958ecbf1a32a66ab2e746879e6c24d36d00107b8b82f55c51753c8c5"
[[files]]
file = "mods/Essential-fabric_1-18-2.jar"
hash = "255b3b4733ff0412d59c24e586f3ce811dc4292abb57a9ce3bd6ecbd6871f1ed"

View file

@ -0,0 +1,43 @@
const itemBlacklist = [
"allium_peripherals:chat_modem_creative"
]
// 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();
};
});

View file

@ -0,0 +1,60 @@
// 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'
})
})

View file

@ -0,0 +1,15 @@
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'
})
})

View file

@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "52ed2fe2e69478737f3574f2b0d2a94ac75134cd4a78d46a1e4271a05cc6e1a5"
hash = "26275b2b09046a422f76808fa4a8045e91cdec30d8ae4e5ebdba3d898483bd73"
[versions]
fabric = "0.14.8"