items:
  default:flame_cane:
    data:
      item-name: <!i><lang:item.default.flame_cane>
    texture: minecraft:item/custom/flame_cane
    behavior:
      type: block_item
      block:
        settings:
          template:
            - default:hardness/none
            - default:sound/grass
          overrides:
            push-reaction: destroy
            map-color: 15
            is-randomly-ticking: true
        behaviors:
          - type: vertical_crop_block
            max-height: 4
            grow-speed: 0.333
            direction: up
          - type: bush_block
            stackable: true
            delay: 1
            bottom-blocks:
              - minecraft:netherrack
              - minecraft:soul_sand
              - minecraft:soul_soil
              - minecraft:magma_block
              - minecraft:warped_nylium
              - minecraft:crimson_nylium
              - minecraft:basalt
          - type: near_liquid_block
            liquid-type: lava
            delay: 1
            stackable: true
            positions:
              - -1,-1,0
              - 1,-1,0
              - 0,-1,-1
              - 0,-1,1
        loot:
          template: default:loot_table/self
        states:
          properties:
            age:
              type: int
              default: 0
              range: 0~5
          appearances:
            default:
              auto-state: sugar_cane
              models:
                - path: minecraft:block/custom/flame_cane_1
                  weight: 1
                  generation:
                    parent: minecraft:block/sugar_cane
                    textures:
                      cross: minecraft:block/custom/flame_cane_1
                - path: minecraft:block/custom/flame_cane_2
                  weight: 1
                  generation:
                    parent: minecraft:block/sugar_cane
                    textures:
                      cross: minecraft:block/custom/flame_cane_2
          variants:
            age=0:
              appearance: default
            age=1:
              appearance: default
            age=2:
              appearance: default
            age=3:
              appearance: default
            age=4:
              appearance: default
            age=5:
              appearance: default
recipes:
  default:magma_cream:
    type: shaped
    pattern:
      - ' A '
      - 'ABA'
      - ' A '
    ingredients:
      A: default:flame_cane
      B: minecraft:slime_ball
    result:
      id: minecraft:magma_cream
      count: 1
  default:magma_block:
    type: shapeless
    ingredients:
      - minecraft:cobblestone
      - minecraft:cobblestone
      - default:flame_cane
      - default:flame_cane
    result:
      id: minecraft:magma_block
      count: 2
placed-features:
  default:flame_cane:
    environment:
      - minecraft:the_nether
    feature:
      type: 'minecraft:random_patch'
      config:
        feature:
          feature:
            type: 'minecraft:block_column'
            config:
              allowed_placement:
                type: 'minecraft:matching_blocks'
                blocks: 'minecraft:air'
              direction: up
              layers:
                - height:
                    type: 'minecraft:biased_to_bottom'
                    max_inclusive: 4
                    min_inclusive: 2
                  provider:
                    type: 'minecraft:simple_state_provider'
                    state:
                      Name: 'default:flame_cane'
                      Properties:
                        age: '0'
              prioritize_tip: false
          placement:
            - type: 'minecraft:block_predicate_filter'
              predicate:
                type: 'minecraft:all_of'
                predicates:
                  - type: 'minecraft:matching_blocks'
                    blocks: 'minecraft:air'
                  - type: 'minecraft:would_survive'
                    state:
                      Name: 'default:flame_cane'
                      Properties:
                        age: '0'
                  - type: 'minecraft:any_of'
                    predicates:
                      - type: 'minecraft:matching_fluids'
                        fluids:
                          - 'minecraft:lava'
                          - 'minecraft:flowing_lava'
                        offset:
                          - 1
                          - -1
                          - 0
                      - type: 'minecraft:matching_fluids'
                        fluids:
                          - 'minecraft:lava'
                          - 'minecraft:flowing_lava'
                        offset:
                          - -1
                          - -1
                          - 0
                      - type: 'minecraft:matching_fluids'
                        fluids:
                          - 'minecraft:lava'
                          - 'minecraft:flowing_lava'
                        offset:
                          - 0
                          - -1
                          - 1
                      - type: 'minecraft:matching_fluids'
                        fluids:
                          - 'minecraft:lava'
                          - 'minecraft:flowing_lava'
                        offset:
                          - 0
                          - -1
                          - -1
        tries: 20
        xz_spread: 4
        y_spread: 0
    placement:
      - type: 'minecraft:rarity_filter'
        chance: 6
      - type: 'minecraft:in_square'
      - type: 'minecraft:height_range'
        height:
          absolute: 32