{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "nicothekid:block_jar_cookies_05",
      "menu_category": {
				"category": "none",
				"group": "none"
			},
			"states": {
				"nicothekid:block_rotation": [
				  0,
				  1,
					2,
					3,
					4,
					5
				]
			}
    },
    "components": {
      "minecraft:material_instances": {
        "*": {
          "texture": "nicothekid_block_jar_cookies_05",
          "render_method": "blend",
          "ambient_occlusion": false,
          "face_dimming": true
        }
      },
      "minecraft:geometry": "geometry.block.nicothekid_jar_cookies",
      "minecraft:map_color": "#D4E5F7",
      "minecraft:breathability": "air",
      "minecraft:placement_filter": {
        "conditions": [
          {
            "allowed_faces": [
              "up",
              "down"
            ]
          }
        ]
      },
      "minecraft:collision_box": {
        "origin": [ -5, 0, -5 ],
        "size": [ 10, 16, 10 ]
      },
      "minecraft:selection_box": {
        "origin": [ -5, 0, -5 ],
        "size": [ 10, 16, 10 ]
      },
      "minecraft:light_dampening": 0,
      "minecraft:light_emission": 0,
      "minecraft:friction": 0.4,
      "minecraft:flammable": false,
      "minecraft:destructible_by_explosion": true,
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 0.1
      },
      "minecraft:loot": "loot_tables/nicos_item_expansion/blocks/nicothekid_block_jar_cookies_05.json",
      "minecraft:on_interact": {
        "event": "nicothekid:block_jar_cookies_05_interact"
      },
      "minecraft:on_player_placing": {
				"event": "nicothekid:placing_rotation"
			},
      "minecraft:transformation": {
			  "rotation": [ 0, 0, 0 ]
			},
      
      "tag:jar_block": {},
      "tag:glass": {}
    },
    "permutations": [
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 0",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 0, 0 ]
          }
        }
      },
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 1",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 0, 0 ]
          }
        }
      },
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 2",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 180, 0 ]
          }
        }
      },
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 3",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 0, 0 ]
          }
        }
      },
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 4",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 270, 0 ]
          }
        }
      },
      {
        "condition": "query.block_state('nicothekid:block_rotation') == 5",
        "components": {
          "minecraft:transformation": {
            "rotation": [ 0, 90, 0 ]
          }
        }
      }
    ],
    "events": {
      "nicothekid:placing_rotation": {
				"set_block_state": {
					"nicothekid:block_rotation": "query.cardinal_facing_2d"
				}
			},
      "nicothekid:block_jar_cookies_05_interact": {
				"sequence": [
					{
						"condition": "query.get_equipped_item_name('main_hand') == 'jar_opener'",
						"trigger": {
							"event": "nicothekid:block_jar_cookies_05_interact_jar_opener",
							"target": "self"
						}
					},
					{
						"condition": "query.get_equipped_item_name('main_hand') == 'cookie'",
						"trigger": {
							"event": "nicothekid:block_jar_cookies_05_interact_cookie",
							"target": "self"
						}
					}
				]
			},
      "nicothekid:block_jar_cookies_05_interact_jar_opener": {
				"sequence": [
					{
						"run_command": {
							"command": [
								"playsound block.itemframe.remove_item @a[r=10]"
							]
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/nicos_item_expansion/event/nicothekid_block_jar_cookies.json"
						}
					},
					{
						"trigger": {
							"event": "nicothekid:block_jar_cookies_05_to_04"
						}
					}
				]
			},
      "nicothekid:block_jar_cookies_05_interact_cookie": {
				"sequence": [
					{
						"run_command": {
							"command": [
								"playsound block.itemframe.add_item @a[r=10]"
							]
						}
					},
					{
						"decrement_stack": {}
					},
					{
						"trigger": {
							"event": "nicothekid:block_jar_cookies_05_to_06"
						}
					}
				]
			},
			"nicothekid:block_jar_cookies_05_to_04": {
        "set_block": {
					"block_type": "nicothekid:block_jar_cookies_04"
				}
      },
			"nicothekid:block_jar_cookies_05_to_06": {
        "set_block": {
					"block_type": "nicothekid:block_jar_cookies_06"
				}
      }
    }
  }
}
