// priority: 0

// Visit the wiki for more info - https://kubejs.com/

// made by blueversal

BlockEvents.placed('create_enchantment_industry:disenchanter', event => {
    const x = event.block.x
    const y = event.block.y
    const z = event.block.z
    for (let dx = -1; dx <= 1; dx++) {
        for (let dy = -1; dy <= 1; dy++) {
            for (let dz = -1; dz <= 1; dz++) {

                if (dx === 0 && dy === 0 && dz === 0)
                    continue
                if (event.level.getBlock(x + dx, y + dy, z + dz).id === 'create_enchantment_industry:disenchanter') {
                    event.block.set('minecraft:air')
                    event.player.tell('§cDisenchanters cannot touch each other.')
                    return
                }
            }
        }
    }
})