forgotten-fronteir/.minecraft/kubejs/server_scripts/blacklist.js
2023-04-24 21:11:12 -07:00

58 lines
No EOL
935 B
JavaScript

const itemBlacklist = [
// "minecraft:stone"
]
ServerEvents.recipes(event => {
for (let item of itemBlacklist) {
event.remove({ output: item })
}
})
ItemEvents.rightClicked(event => {
for (let item of itemBlacklist) {
if (event.item.id == item) {
event.cancel()
}
}
})
ItemEvents.pickedUp(event => {
for (let item of itemBlacklist) {
if (event.item.id == item) {
event.cancel()
}
}
})
ItemEvents.dropped(event => {
for (let item of itemBlacklist) {
if (event.item.id == item) {
event.cancel()
}
}
})
// Block events
BlockEvents.broken(event => {
for (let item of itemBlacklist) {
if (event.block.id == item) {
event.cancel()
}
}
})
BlockEvents.placed(event => {
for (let item of itemBlacklist) {
if (event.block.id == item) {
event.cancel()
}
}
})
BlockEvents.rightClicked(event => {
for (let item of itemBlacklist) {
if (event.block.id == item) {
event.cancel()
}
}
})