{
	"format_version": "1.17.0",
	"minecraft:block": {
		"description": {
			"identifier": "furnicraft:cactus_log",
			"properties": {
				"furnicraft:direction": [
					0,
					1,
					2
				]
			}
		},
		"permutations": [
			{
				"condition": "query.block_property('furnicraft:direction') == 0",
				"components": {
					"minecraft:rotation": [
						0,
						0,
						0
					]
				}
			},
			{
				"condition": "query.block_property('furnicraft:direction') == 1",
				"components": {
					"minecraft:rotation": [
						270,
						0,
						0
					]
				}
			},
			{
				"condition": "query.block_property('furnicraft:direction') == 2",
				"components": {
					"minecraft:rotation": [
						0,
						0,
						270
					]
				}
			}
		],
		"components": {
            "minecraft:loot": "loot_tables/blocks/tree/cactusbase.json",
            "minecraft:geometry": "geometry.cactus1",
			"minecraft:destroy_time": 1.0,
			"minecraft:on_player_placing": {
				"event": "minecraft:placing_direction",
				"target": "self"
			},
			"minecraft:material_instances": {
				"*": {
					"render_method": "opaque",
					"texture": "cactuside"
				},
				"up": {
					"render_method": "opaque",
					"texture": "cactuside"
				},
				"down": {
					"render_method": "opaque",
					"texture": "cactuside"
				}
			},
            "minecraft:pick_collision": {
                "origin": [ -8, 0, -8 ],
                "size": [ 16, 16, 16 ]
            },
            "minecraft:entity_collision": {
                "origin": [ -7, 0, -7 ],
                "size": [ 14, 16, 14 ]
            },
	        "minecraft:placement_filter": {
		        "conditions": [
			        {
				        "block_filter": ["minecraft:sand","furnicraft:cactus_log"],
				        "allowed_faces": ["up"]
                    }
                ]
            },
			"minecraft:ticking": {
				"looping": true,
		        "range": [1, 1],
				"on_tick": {
					"event": "damage",
					"target": "self"
				}
			},
            "minecraft:on_interact": { 
			"event": "active"
			},
            "minecraft:random_ticking": {
              "on_tick": {
                "event": "furnicraft:active",
                "target": "self"
              }
            },
            "minecraft:block_light_absorption": 0.5,
            "minecraft:block_light_emission": 0.2,
			"minecraft:on_player_destroyed": {
				"event": "leaves_decay",
				"target": "self"
			},
			"tag:cactus": {}
		},
		"events": {
	        "active": {
		        "damage": {
			        "type": "magic",
			        "target": "other",
			        "amount": 1
				}
			},
			"damage": {
				"run_command": {
					"command": [
						"effect @e[r=1.1] wither 1 2 true", 
						"kill @e[type=item,r=1]"
					]
				}
			},
			"minecraft:placing_direction": {
				"set_block_property": {
					"furnicraft:direction": "math.floor(query.cardinal_block_face_placed_on / 2.0)"
				}
			},
			"leaves_decay": {
				"run_command": {
					"command": [
						"fill ~3 ~ ~3 ~-3 ~2 ~-3 furnicraft:black_leaves_decay 0 replace furnicraft:black_leaves"
					]
				}
			}
		}
	}
}