{
  "format_version": "1.16.0",
  "minecraft:block": {
    "description": {
      "identifier": "grunt:custom_crop",
      "properties": {
        "grunt:grow_state": [0, 1, 2, 3, 4, 5, 6, 7]
      }
    },
    "components": {
      "minecraft:pick_collision": {
        "origin":  [-8, 0, -8],
        "size":  [16, 2, 16]
      },
      "minecraft:breakonpush": true,
      "minecraft:placement_filter": {
        "conditions": [
          {"allowed_faces": ["up"],"block_filter": [{"tags": "q.any_tag('dirt', 'grass')"},"minecraft:grass"]}
        ]
      },
      "minecraft:breathability": "air",
      "minecraft:entity_collision": false,
      "minecraft:geometry": "geometry.foliage",
      "minecraft:random_ticking": {"on_tick": {"event": "grow"}},
      "minecraft:map_color": "#272727",
      "minecraft:block_light_absorption": 0,
      "minecraft:block_light_emission": 0,
      "minecraft:explosion_resistance": 0,
      "minecraft:destroy_time": 0,
      "minecraft:friction": 0.6,
      "minecraft:flammable": {
        "flame_odds": 0,
        "burn_odds": 0
      },
      "tag:plant": {}
    },
    "events": {
      "grow": {
        "randomize": [{"weight": 1},{"weight": 1,"set_block_property": {"grunt:grow_state": "(query.block_property('grunt:grow_state') < 3) ? query.block_property('grunt:grow_state') + 1 : 3"}}]
      },
      "fertilize_block": {
        "decrement_stack": {},"play_effect": {"effect": "minecraft:villager_happy"},"set_block_property": {"grunt:grow_state": "(query.block_property('grunt:grow_state') == 0) ? query.block_property('grunt:grow_state') + math.random(1,3) : 3"}
      },
      "harvest": {
        "set_block_property": {
          "grunt:grow_state": "1"
        },
        "spawn_loot": {
          "table": "loot_tables/blocks/blackberry_grown.json"
        }
      }
    },
    "permutations": [
      {
        "condition": "query.block_property('grunt:grow_state') == 0",
        "components": {
          "minecraft:material_instances": {"*": {"texture": "sweet_berry_bush_0","render_method": "alpha_test","face_dimming": false,"ambient_occlusion": false}},
          "minecraft:on_interact": {"condition": "query.get_equipped_item_name == 'bone_meal'","event": "fertilize_block"},
          "minecraft:pick_collision": {"origin":  [-3, 0, -3],"size":  [6, 9, 6]}
        }
      },
      {
        "condition": "query.block_property('grunt:grow_state') == 1",
        "components": {
          "minecraft:material_instances": {"*": {"texture": "sweet_berry_bush_1","render_method": "alpha_test","face_dimming": false,"ambient_occlusion": false}},
          "minecraft:on_interact": {"condition": "query.get_equipped_item_name == 'bone_meal'","event": "fertilize_block"},
          "minecraft:pick_collision": {"origin":  [-7.25, 0, -7.25],"size":  [14.5, 16, 14.5]}
        }
      },
      {
        "condition": "query.block_property('grunt:grow_state') == 2",
        "components": {
          "minecraft:material_instances": {"*": {"texture": "sweet_berry_bush_2","render_method": "alpha_test","face_dimming": false,"ambient_occlusion": false}},
          "minecraft:on_interact": {"condition": "query.get_equipped_item_name == 'bone_meal'","event": "fertilize_block"},
          "minecraft:pick_collision": {"origin":  [-7.25, 0, -7.25],"size":  [14.5, 16, 14.5]}
        }
      },
      {
        "condition": "query.block_property('grunt:grow_state') == 3",
        "components": {
          "minecraft:loot": "loot_tables/blocks/blackberry_grown.json",
          "minecraft:material_instances": {"*": {"texture": "sweet_berry_bush_3","render_method": "alpha_test","face_dimming": false,"ambient_occlusion": false}},
          "minecraft:on_interact": {"event": "harvest"},
          "minecraft:pick_collision": {"origin":  [-7.25, 0, -7.25],"size":  [14.5, 16, 14.5]}
        }
      }
    ]
  }
}