#Limit block placement

5 messages · Page 1 of 1 (latest)

ornate heron
#

I'm trying to limit the blocks that can be placed within a certain area, I've got an idea how to check whether a player is in the area already, but I'm not sure how to limit block placement.

desert relicBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

ornate heron
#

I've found this in another post, can you use an array instead of just one block here? BlockEvents.placed('ad_astra:coal_generator',event=>{
if (event.level.dimension == 'minecraft:overworld')
event.player.tell('Wrong Dimension')
event.cancel()
})

ornate heron
#

Figured it out

#

BlockEvents.placed( e => {
let array = [minecraft:stone, minecraft:oak_planks];
let block = e.getBlock();
if(!array.includes(block.toString())) {
e.cancel();
}
})