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

50 lines
No EOL
994 B
JavaScript

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();
};
});