{
  "format_version": "1.20.30",
  "minecraft:block": {
    "description": {
      "identifier": "megaverse:tatara_smelter_core",
      "menu_category": {
        "category": "items",
        "group": "itemGroup.name.tatara_furnace",
        "is_hidden_in_commands": false
      },
      "states": {
        "megaverse:complete_setup": [ false, true ]
      },
      "traits": {
        "minecraft:placement_direction": {
          "enabled_states": ["minecraft:cardinal_direction"],
          "y_rotation_offset": 180
        }
      }
    },
    "components": {
      "minecraft:material_instances": {
        "*": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
        "bottom": { "texture": "tatara_smelter_core_bottom_off", "render_method": "alpha_test", "ambient_occlusion": true },
        "inside": { "texture": "tatara_smelter_core_inside_off", "render_method": "alpha_test", "ambient_occlusion": true },
        "outside": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
        "top": { "texture": "tatara_smelter_core_top_off", "render_method": "alpha_test", "ambient_occlusion": true }
      },
      "minecraft:display_name": "tile.tatara_smelter_core.name",
      "minecraft:destructible_by_mining": { "seconds_to_destroy": 6.25 },
      "minecraft:destructible_by_explosion": { "explosion_resistance": 4.2 },
      "minecraft:light_dampening": 15,
      "minecraft:map_color": "#E6F4FF",
      "minecraft:breathability": "solid",
      "minecraft:geometry": "geometry.tatara_smelter_core",
      "minecraft:collision_box": { "origin": [ -8.0, 0.0, -8.0 ], "size": [ 16.0, 15.0, 16.0 ] },
      "minecraft:selection_box": true,
      "tag:stone": { },
      "tag:tatara_smelter_core": { }
    },
    "permutations": [
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'north'",
        "components": {
          "tag:tatara_sorth_setup": { },
          "minecraft:transformation": { "scale": [ 1, 1.5, 1 ], "translation": [0, 0.25, 0], "rotation": [ 0.0, 180.0, 0.0 ] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'south'",
        "components": {
          "tag:tatara_sorth_setup": { },
          "minecraft:transformation": { "scale": [ 1, 1.5, 1 ], "translation": [0, 0.25, 0], "rotation": [ 0.0, 0.0, 0.0 ] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'west'",
        "components": {
          "tag:tatara_weast_setup": { },
          "minecraft:transformation": { "scale": [ 1, 1.5, 1 ], "translation": [0, 0.25, 0], "rotation": [ 0.0, -90.0, 0.0 ] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'east'",
        "components": {
          "tag:tatara_weast_setup": { },
          "minecraft:transformation": { "scale": [ 1, 1.5, 1 ], "translation": [0, 0.25, 0], "rotation": [ 0.0, 90.0, 0.0 ] }
        }
      },
      {
        "condition": "q.block_state('megaverse:complete_setup') == false",
        "components": {
          "minecraft:queued_ticking": {
            "looping": true,
            "interval_range": [ 0, 0 ],
            "on_tick": { "event": "minecraft:on_detect_requirements" }
          },
          "minecraft:light_emission": 0.0,
          "minecraft:material_instances": {
            "*": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
            "bottom": { "texture": "tatara_smelter_core_bottom_off", "render_method": "alpha_test", "ambient_occlusion": true },
            "inside": { "texture": "tatara_smelter_core_inside_off", "render_method": "alpha_test", "ambient_occlusion": true },
            "outside": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
            "top": { "texture": "tatara_smelter_core_top_off", "render_method": "alpha_test", "ambient_occlusion": true }
          }
        }
      },
      {
        "condition": "q.block_state('megaverse:complete_setup') == true",
        "components": {
          "tag:tatara_complete_setup": { },
          "minecraft:queued_ticking": {
            "looping": true,
            "interval_range": [ 0, 0 ],
            "on_tick": { "event": "minecraft:on_detect_requirements" }
          },
          "minecraft:light_emission": 15.0,
          "minecraft:material_instances": {
            "*": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
            "bottom": { "texture": "tatara_smelter_core_bottom_on", "render_method": "alpha_test", "ambient_occlusion": true },
            "inside": { "texture": "tatara_smelter_core_inside_on", "render_method": "alpha_test", "ambient_occlusion": true },
            "outside": { "texture": "tatara_smelter_core_outside", "render_method": "alpha_test", "ambient_occlusion": true },
            "top": { "texture": "tatara_smelter_core_top_on", "render_method": "alpha_test", "ambient_occlusion": true }
          },
          "minecraft:random_ticking": {
            "on_tick": { "event": "minecraft:random_fire", "target": "self" }
          },
          "minecraft:crafting_table": {
            "table_name": "container.tatara_furnace",
            "grid_size": 3,
            "crafting_tags": [ "tatara_furnace" ]
          }
        }
      }
    ],
    "events": {
      "minecraft:random_fire": {
        "play_sound": { "sound": "block.campfire.crackle", "target": "self" },
        "run_command": { "command": "particle megaverse:tatara_furnace_ember_sparks ~~~" }
      },
      "minecraft:on_detect_requirements": {
        "sequence": [
          {
            "condition": "q.block_state('megaverse:complete_setup') == true",
            "run_command": { "command": [ "damage @e[family=mob,r=0.80] 1 fire", "damage @a[m=!c,r=0.80] 1 fire" ] }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": true }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": true }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && !q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && !q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && !q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && !q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && !q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && !q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && !q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_weast_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(1,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(-1,0,0,'tatara_smelter','facing_west') && q.block_neighbor_has_all_tags(1,0,0,'tatara_smelter','facing_east') && q.block_neighbor_has_all_tags(0,0,1,'tatara_manifold','facing_north','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,0,-1,'tatara_manifold','facing_south','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          },
          {
            "condition": "(q.block_neighbor_has_all_tags(0,0,0,'tatara_sorth_setup') && q.block_neighbor_has_all_tags(0,-1,0,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,-1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,-1,1,'tatara_furnace_bricks') && q.block_neighbor_has_all_tags(0,0,-1,'tatara_smelter','facing_north') && q.block_neighbor_has_all_tags(0,0,1,'tatara_smelter','facing_south') && q.block_neighbor_has_all_tags(1,0,0,'tatara_manifold','facing_west','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(-1,0,0,'tatara_manifold','facing_east','tatara_complete_bellows') && !q.block_neighbor_has_all_tags(0,1,0,'tatara_smelter'))",
            "set_block_state": { "megaverse:complete_setup": false }
          }
        ]
      }
    }
  }
}

{
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 1",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge1.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 2",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge2.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 3",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge3.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 4",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge4.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 5",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge5.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 6",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge6.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 7",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge7.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 8",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge8.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 9",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_charge9.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 10",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_fully_charged.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 11 || q.block_state('megaverse:tatara_furnace_charge') == 12",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_half_smelted.json" }
          },
          {
            "condition": "q.block_state('megaverse:tatara_furnace_charge') == 13 || q.block_state('megaverse:tatara_furnace_charge') == 14",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_most_smelted.json" }
          },
          {
            "condition": "q.block_state('megaverse:tamahagane_quality') == 9",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_output.json" }
          },
          {
            "condition": "q.block_state('megaverse:tamahagane_quality') == 10",
            "spawn_loot": { "table": "loot_tables/blocks/items/tatara_furnace_items/tatara_smelter_exquisite_output.json" }
          },