ultron/.minecraft/kubejs/server_scripts/ultron-blacklist.js

43 lines
873 B
JavaScript
Raw Normal View History

2022-08-20 16:53:11 +01:00
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();
};
});