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

58 lines
935 B
JavaScript
Raw Normal View History

2023-04-15 08:54:31 +01:00
const itemBlacklist = [
2023-04-25 05:11:12 +01:00
// "minecraft:stone"
2023-04-15 08:54:31 +01:00
]
2023-04-25 05:11:12 +01:00
ServerEvents.recipes(event => {
for (let item of itemBlacklist) {
event.remove({ output: item })
}
})
2023-04-15 08:54:31 +01:00
2023-04-25 05:11:12 +01:00
ItemEvents.rightClicked(event => {
for (let item of itemBlacklist) {
if (event.item.id == item) {
event.cancel()
}
}
})
2023-04-15 08:54:31 +01:00
2023-04-25 05:11:12 +01:00
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()
}
}
})