{
    "format_version": "1.20.50",
    "minecraft:block": {
        "description": {
            "identifier": "rc:cannon",
            "menu_category": {
                "category": "items",
                "group": "itemGroup.name.create",
                "is_hidden_in_commands": false
            },
            "states": {
                "rc:placed": [false, true]
            }
        },
        "components": {
            "minecraft:material_instances": {
                "*": {
                    "render_method": "blend",
                    "texture": "cannon"
                }
            },
            "minecraft:geometry":{
                "identifier": "geometry.create_cannon_block"
            },
            "minecraft:destructible_by_explosion": true,
            "minecraft:destructible_by_mining": true,
            "minecraft:collision_box": true,
            "minecraft:selection_box": true,
            "minecraft:map_color": "#FFFFFF",
            "minecraft:on_interact": {
                "event": "interact"
            },
            "minecraft:on_placed": {
                "condition": "q.block_state('rc:placed') == false",
                "event": "placed"
            }
        },
        "events": {
            "placed":{
                "set_block_state": {
                    "rc:placed": true
                },
                "run_command": {
                    "command":["summon rc:cannon ~~-0.5~ "]
                }
            }
        },
        "permutations": [
            {
                "condition": "q.block_state('rc:placed') == true",
                "components": {
                    "minecraft:geometry":{
                        "identifier": "geometry.unknown"
                    }
                }
            }
        ]
    }
}