{
  "format_version": "1.16.100",
  "minecraft:block": {
    "description": {
      "identifier": "loled:grill",
      "properties": {
        "loled:face": [
          0,
          1,
          2,
          3
        ],
        "loled:beef": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7
        ]
      }
    },
    "components": {
      "minecraft:material_instances": {
        "*": {
          "texture": "grill_base",
          "render_method": "alpha_test"
        }
      },
      "minecraft:pick_collision": {
        "origin": [
          -7,
          0,
          -7
        ],
        "size": [
          14,
          15,
          14
        ]
      },
      "minecraft:creative_category": {
        "group": "itemGroup.name.garden",
        "category": "construction"
      },
      "minecraft:loot": "loot_tables/garden/grill.json",
      "minecraft:geometry": "geometry.grill_base",
      "minecraft:destroy_time": 2,
      "minecraft:block_light_absorption": 0,
      "minecraft:unwalkable": true,
      "minecraft:entity_collision": {
        "origin": [
          -7,
          0,
          -7
        ],
        "size": [
          14,
          15,
          14
        ]
      },
      "minecraft:friction": 0.6,
      "minecraft:map_color": "#00ff00",
      "minecraft:flammable": {
        "flame_odds": 0,
        "burn_odds": 0
      },
      "minecraft:on_interact": {
        "event": "loled:toggle",
        "condition": "query.get_equipped_item_name=='coal'"
      },
      "minecraft:on_player_placing": {
        "event": "loled:face"
      }
    },
    "permutations": [
      {
        "condition": "query.block_property('loled:face') == 0",
        "components": {
          "minecraft:rotation": [
            0,
            180,
            0
          ]
        }
      },
      {
        "condition": "query.block_property('loled:face') == 1",
        "components": {
          "minecraft:rotation": [
            0,
            0,
            0
          ]
        }
      },
      {
        "condition": "query.block_property('loled:face') == 2",
        "components": {
          "minecraft:rotation": [
            0,
            270,
            0
          ]
        }
      },
      {
        "condition": "query.block_property('loled:face') == 3",
        "components": {
          "minecraft:rotation": [
            0,
            90,
            0
          ]
        }
      },
      {
        "condition": "query.block_property('loled:beef')==1",
        "components": {
          "minecraft:geometry": "geometry.grill_base",
		  "minecraft:ticking": {
            "looping": true,
            "range": [
              0,
              0
            ],
            "on_tick": {
              "event": "fire_particle"
            }
          },
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "beef_1",
            "condition": "query.get_equipped_item_name=='beef'"
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_beef_raw",
              "render_method": "alpha_test"
            }
          }
        }
      },
      {
        "condition": "query.block_property('loled:beef')==2",
        "components": {
          "minecraft:geometry": "geometry.grill_items_1",
		  "minecraft:ticking": {
            "looping": true,
            "range": [
              0,
              0
            ],
            "on_tick": {
              "event": "fire_particle"
            }
          },
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "beef_2",
            "condition": "query.get_equipped_item_name=='beef'"
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_beef_raw",
              "render_method": "alpha_test"
            }
          }
        }
      },
      {
        "condition": "query.block_property('loled:beef')==3",
        "components": {
          "minecraft:geometry": "geometry.grill_items_2",
		  "minecraft:ticking": {
            "looping": false,
            "range": [
              0,
              0
            ],
            "on_tick": {
              "event": "fire_particle_1"
            }
          },
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "beef_3",
            "condition": "query.get_equipped_item_name=='beef'"
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_beef_raw",
              "render_method": "alpha_test"
            }
          }
        }
      },
      {
        "condition": "query.block_property('loled:beef')==4",
        "components": {
          "minecraft:geometry": "geometry.grill_items_3",
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "nothing"
          },
		  "minecraft:ticking": {
            "looping": true,
            "range": [
              1,
              16
            ],
            "on_tick": {
              "event": "beef_ready"
            }
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_beef_raw",
              "render_method": "alpha_test"
            }
          }
        }
      },
	  {
        "condition": "query.block_property('loled:beef')==5",
        "components": {
          "minecraft:geometry": "geometry.grill_items_3",
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "take_beef"
          },
          "minecraft:ticking": {
            "looping": true,
            "range": [
              1,
              16
            ],
            "on_tick": {
              "event": "beef_burning"
            }
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_beef_cooked",
              "render_method": "alpha_test"
            }
          }
        }
      },
	  {
        "condition": "query.block_property('loled:beef')==6",
        "components": {
          "minecraft:geometry": "geometry.grill_items_3",
          "minecraft:block_light_absorption": 0,
          "minecraft:on_interact": {
            "event": "beef_burned"
          },
          "minecraft:material_instances": {
            "*": {
              "texture": "grill_base",
              "render_method": "alpha_test"
            }
          }
        }
      }
    ],
    "events": {
      "loled:face": {
        "set_block_property": {
          "loled:face": "query.cardinal_facing_2d-2"
        }
      },
	  "fire_particle": {
        "run_command": {
          "command": [
            "particle grill:flame_cooking ~~0.5~",
            "playsound block.smoker.smoke @p ~~~ 1 5"
          ]
        }
      },
	  "fire_particle_1": {
        "run_command": {
          "command": [
            "particle grill:flame_cooking_steady ~~0.5~",
            "playsound fire.effect @p ~~~ 1 1"
          ]
        }
      },
      "loled:toggle": {
        "set_block_property": {
          "loled:beef": "query.block_property('loled:beef')+1"
        },
        "run_command": {
          "command": [
            "title @p actionbar Beef to continue"
          ]
        },
        "decrement_stack": {}
      },
      "beef_1": {
        "set_block_property": {
          "loled:beef": 2
        },
        "run_command": {
          "command": [
            "title @p actionbar Use more two beef to continue"
          ]
        },
		"decrement_stack": {}
      },
      "beef_2": {
        "set_block_property": {
          "loled:beef": 3
        },
        "run_command": {
          "command": [
            "title @p actionbar Use more one beef to continue"
          ]
        },
		"decrement_stack": {}
      },
      "beef_3": {
        "set_block_property": {
          "loled:beef": 4
        },
		"decrement_stack": {}
      },
      "beef_ready": {
        "set_block_property": {
          "loled:beef": 5
        },
		"run_command": {
          "command": [
            "playsound fire.effect @p ~~~ 1 1"
          ]
        }
      },
	  "take_beef": {
        "set_block_property": {
          "loled:beef": 0
        },
        "spawn_loot": {
          "table": "loot_tables/blocks/cooked_beef.json"
        }
      },
	  "beef_burning": {
        "set_block_property": {
          "loled:beef": 6
        },
		"run_command": {
          "command": [
            "playsound fire.effect @p ~~~ 1 1"
          ]
        }
      },
	  "beef_burned": {
        "set_block_property": {
          "loled:beef": 0
        },
        "spawn_loot": {
          "table": "loot_tables/blocks/coal.json"
        }
      }
    }
  }
}