const END_EXPLOSIVE_ENGINES = [
    'create:steam_engine',
    'createdieselgenerators:diesel_engine',
    'createdieselgenerators:large_diesel_engine',
    'createdieselgenerators:huge_diesel_engine'
]



BlockEvents.placed(event => {
    const level = event.level
    const block = event.block

    if (level.dimension !== 'minecraft:the_end') return
    if (!END_EXPLOSIVE_ENGINES.includes(block.id)) return

    const x = block.x
    const y = block.y
    const z = block.z

    block.set('minecraft:air')
    level.runCommandSilent(`summon tnt ${x + 0.5} ${y + 0.5} ${z + 0.5} {Fuse:0}`)

    if (event.player) {
        event.player.tell('The engine violently destabilizes in The End.')
    }
})
