{
    "format_version": "1.20.0",
    "minecraft:entity": {
        "description": {
            "identifier": "lv_te:auto_treecutter",
            "is_spawnable": false,
            "is_summonable": true,
            "is_experimental": false,
            "animations": {
                "fuel_dummy_spawning": "controller.animation.lv_te.fuel_dummy_spawning"
            },
            "scripts": {
                "animate": [
                    "fuel_dummy_spawning"
                ]
            },
            "properties": {
                "lv.te:cracking": {
                    "client_sync": true,
                    "default": 0,
                    "range": [
                        0,
                        3
                    ],
                    "type": "int"
                },
                "lv_te:is_full": {
                    "client_sync": true,
                    "default": false,
                    "type": "bool"
                },
                // 0 = no growing, 1 = is growing, 2 = is fully grown
                "lv_te:grow_tree": {
                    "client_sync": true,
                    "default": 0,
                    "range": [
                        0,
                        2
                    ],
                    "type": "int"
                },
                "lv_te:sapling": {
                    "client_sync": true,
                    "default": 0,
                    "range": [
                        0,
                        8
                    ],
                    "type": "int"
                },
                "lv_te:charge": {
                    "client_sync": true,
                    "default": 0,
                    "range": [
                        0,
                        100
                    ],
                    "type": "int"
                }
            }
        },
        "component_groups": {
            "lv_te:despawn": {
                "minecraft:instant_despawn": {
                    "remove_child_entities": false
                }
            }
        },
        "components": {
            "minecraft:type_family": {
                "family": [
                    "lv.te.machine",
                    "inanimate",
                    "lv_te:charge_bar"
                ]
            },
            "minecraft:nameable": {
                "allow_name_tag_renaming": false
            },
            "minecraft:damage_sensor": {
                "triggers": [
                    {
                        "on_damage": {
                            "filters": [
                                {
                                    "all_of": [
                                        {
                                            "test": "is_family",
                                            "subject": "damager",
                                            "value": "player"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:cracking"
                        },
                        "deals_damage": false
                    },
                    {
                        "cause": "all",
                        "deals_damage": false
                    }
                ]
            },
            "minecraft:interact": {
                "interactions": [
                    {
                        "on_interact": {
                            "filters": {
                                "all_of": [
                                    {
                                        "test": "is_family",
                                        "subject": "other",
                                        "operator": "equals",
                                        "value": "player"
                                    },
                                    {
                                        "test": "has_equipment",
                                        "subject": "other",
                                        "domain": "hand",
                                        "operator": "==",
                                        "value": "lv_te:gasoline"
                                    },
                                    {
                                        "test": "int_property",
                                        "subject": "self",
                                        "domain": "lv_te:charge",
                                        "operator": "!=",
                                        "value": 100
                                    }
                                ]
                            },
                            "event": "lv_te:fuel_coal"
                        },
                        "interact_text": "action.interact.fuel",
                        "use_item": true,
                        "swing": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:oak_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:oak_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:spruce_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:spruce_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:birch_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:birch_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:jungle_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:jungle_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:acacia_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:acacia_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:dark_oak_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:dark_oak_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:pale_oak_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:pale_oak_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    },
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "any_of": [
                                        {
                                            "test": "has_equipment",
                                            "domain": "hand",
                                            "subject": "other",
                                            "value": "minecraft:cherry_sapling"
                                        }
                                    ]
                                }
                            ],
                            "target": "self",
                            "event": "lv_te:cherry_sapling"
                        },
                        "swing": true,
                        "use_item": true
                    }
                ]
            },
            "minecraft:health": {
                "min": 1,
                "value": 1,
                "max": 1
            },
            "minecraft:collision_box": {
                "width": 0.01,
                "height": 0.01
            },
            "minecraft:custom_hit_test": {
                "hitboxes": [
                    {
                        "width": 1,
                        "height": 1,
                        "pivot": [
                            0,
                            0.5,
                            0
                        ]
                    }
                ]
            },
            "minecraft:breathable": {
                "total_supply": 15,
                "suffocate_time": 0
            },
            "minecraft:inventory": {
                "can_be_siphoned_from": true,
                "container_type": "container",
                "inventory_size": 27,
                "private": false,
                "restrict_to_owner": false
            },
            "minecraft:physics": {
                "has_gravity": false,
                "has_collision": false
            },
            "minecraft:pushable": {
                "is_pushable": false,
                "is_pushable_by_piston": false
            },
            "minecraft:knockback_resistance": {
                "value": 1
            },
            "minecraft:fire_immune": {},
            "minecraft:conditional_bandwidth_optimization": {}
        },
        "events": {
            "minecraft:entity_spawned": {},
            "lv_te:remove_machine": {
                "add": {
                    "component_groups": [
                        "lv_te:despawn"
                    ]
                },
                "queue_command": {
                    "command": "event entity @e[type=lv_te:charge_dummy, r=2] lv_te:despawn"
                }
            },
            "lv_te:oak_sapling": {
                "set_property": {
                    "lv_te:sapling": 1
                }
            },
            "lv_te:spruce_sapling": {
                "set_property": {
                    "lv_te:sapling": 2
                }
            },
            "lv_te:birch_sapling": {
                "set_property": {
                    "lv_te:sapling": 3
                }
            },
            "lv_te:jungle_sapling": {
                "set_property": {
                    "lv_te:sapling": 4
                }
            },
            "lv_te:acacia_sapling": {
                "set_property": {
                    "lv_te:sapling": 5
                }
            },
            "lv_te:dark_oak_sapling": {
                "set_property": {
                    "lv_te:sapling": 6
                }
            },
            "lv_te:pale_oak_sapling": {
                "set_property": {
                    "lv_te:sapling": 7
                }
            },
            "lv_te:cherry_sapling": {
                "set_property": {
                    "lv_te:sapling": 8
                }
            },
            "lv_te:reset_cracking": {
                "set_property": {
                    "lv.te:cracking": 0
                }
            },
            "lv_te:cracking": {
                "queue_command": {
                    "command": "scriptevent lv.te:machines.cracking"
                }
            },
            "lv_te:fuel_coal": {
                "queue_command": {
                    "command": "scriptevent lv.te:machines.fuel.coal"
                }
            }
        }
    }
}