ultron/.minecraft/kubejs/server_scripts/ultron-blacklist.js
2022-08-20 08:53:11 -07:00

43 lines
No EOL
873 B
JavaScript

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