{
    "format_version": "1.16.100",
    "minecraft:block": {
        "description": {
            "identifier": "furnicraft:puerta_azul_3",
            "properties": {
                "furnicraft:face": [ 2, 3, 4, 5, 6 ],
                "furnicraft:active": [ false, true ]
            }
        },
        "components": {
		    "minecraft:creative_category": {
            "group": "itemGroup.name.furnicraft_trampillas",
            "category": "items"
		    },
            "minecraft:material_instances": {
                "*": {
                    "texture": "auto_azul",
                    "render_method": "alpha_test"
                }
            },
            "minecraft:pick_collision": {
                "origin": [ -8, 0, -8 ],
                "size": [ 16, 16, 1 ]
            },
            "minecraft:loot": "loot_tables/blocks/puerta3/azul.json",
            "minecraft:geometry": "geometry.puerta_trampilla_open",
            "minecraft:destroy_time": 1,
			"minecraft:block_light_absorption": 0.5,
            "minecraft:block_light_emission": 0.2,
            "minecraft:unwalkable": true,
	    "minecraft:preventsjumping": false,
            "minecraft:entity_collision": {
                "origin": [ -8, 0, -8 ],
                "size": [ 16, 16, 1 ]
            },
            "minecraft:destroy_time": 1.0,
            "minecraft:friction": 0.6,
            "minecraft:map_color": "#00ff00",
            "minecraft:flammable": {
                "flame_odds": 0,
                "burn_odds": 0
            },

            "minecraft:on_interact": { 
			"event": "furnicraft:toggle"
			},
            "minecraft:on_player_placing": { "event": "furnicraft:face" }
        },
        "permutations": [
            {
                "condition": "query.block_property('furnicraft:face') == 3",
                "components": { "minecraft:rotation": [ 0, 180, 0 ] }
            }, {
                "condition": "query.block_property('furnicraft:face') == 4",
                "components": { "minecraft:rotation": [ 0, 90, 0 ] }
            }, {
                "condition": "query.block_property('furnicraft:face') == 5",
                "components": { "minecraft:rotation": [ 0, 270, 0 ] }
            },
			
            { 
                "condition": "!query.block_property('furnicraft:active')",
                "components": {
                    "minecraft:loot": "loot_tables/blocks/puertas3/azul.json",
                    "minecraft:geometry": "geometry.puerta_trampilla_close",
			        "minecraft:block_light_absorption": 0.5,
                    "minecraft:block_light_emission": 0.2,
                    "minecraft:material_instances": {
                        "*": {
                            "texture": "auto_azul",
                            "render_method": "alpha_test"
                        }
                    },
                    "minecraft:pick_collision": {
                        "origin": [ -8, 0, -8 ],
                        "size": [ 16, 2, 16 ]
                    },
                    "minecraft:entity_collision": {
                        "origin": [ -8, 0, -8 ],
                        "size": [ 16, 2, 16 ]
				    }
				}
            }
        ],
        "events": {
            "furnicraft:face": {
                "set_block_property": {
                    "furnicraft:face": "(query.cardinal_player_facing)"
                }
            },
            "furnicraft:toggle": { 
                "set_block_property": {
                    "furnicraft:active": "query.block_property('furnicraft:active') ? false : true"
                },
                "run_command": {
                    "command": [ "playsound random.door_close @a[r=5] ~ ~ ~ 0.4 1.0" ]
                }		
            }
        }
    }
}