forgotten-fronteir/.minecraft/kubejs/server_scripts/blacklist.js

50 lines
994 B
JavaScript
Raw Normal View History

2023-04-15 08:54:31 +01:00
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();
};
});