{
  "format_version": "1.16.100",
  "minecraft:block": {
    "description": {
      "identifier": "darkgato:snowman_head",
      "properties": {
        "block:rotation": [ 2, 3, 4, 5 ],
        "block:face": [ 1, 2, 3, 4 ]
      }
    },
    "components": {
      "minecraft:material_instances": {
        "*": {
          "texture": "snowman_default_face",
          "render_method": "opaque"
        }
      },
      "minecraft:geometry": "geometry.snowman_head",
      "minecraft:destroy_time": 1,
      "minecraft:explosion_resistance": 0,
      "minecraft:flammable": {
        "flame_odds": 15,
        "burn_odds": 15
      },
      "minecraft:block_light_absorption": 0,
      "minecraft:on_interact": {
        "event": "change_face"
      },
      "minecraft:on_placed": {
        "event": "select_rotation"
      },
      "minecraft:placement_filter": {
        "conditions": [
          {
            "block_filter": [
              "darkgato:snowman_body"
            ],
            "allowed_faces": [ "up" ]
          }
        ]
      },
      "minecraft:pick_collision": {
        "origin": [ -4, 4, -4 ],
        "size": [ 8, 8, 8 ]
      },
      "minecraft:entity_collision": {
        "origin": [ -4, 4, -4 ],
        "size": [ 8, 8, 8 ]
      },
      "minecraft:loot": "loot_tables/air.json"
    },
    "permutations": [
      {
        "condition": "query.block_property('block:rotation') == 2",
        "components": {
          "minecraft:rotation": [ 0, 0, 0 ]
        }
      },
      {
        "condition": "query.block_property('block:rotation') == 3",
        "components": {
          "minecraft:rotation": [ 0, -180, 0 ]
        }
      },
      {
        "condition": "query.block_property('block:rotation') == 4",
        "components": {
          "minecraft:rotation": [ 0, 90, 0 ]
        }
      },
      {
        "condition": "query.block_property('block:rotation') == 5",
        "components": {
          "minecraft:rotation": [ 0, -90, 0 ]
        }
      },
      {
        "condition": "query.block_property('block:face') == 1",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "snowman_default_face",
              "render_method": "opaque"
            }
          }
        }
      },
      {
        "condition": "query.block_property('block:face') == 2",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "snowman_happy_face",
              "render_method": "opaque"
            }
          }
        }
      },
      {
        "condition": "query.block_property('block:face') == 3",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "snowman_calm_face",
              "render_method": "opaque"
            }
          }
        }
      },
      {
        "condition": "query.block_property('block:face') == 4",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "snowman_smiling_face",
              "render_method": "opaque"
            }
          }
        }
      }
    ],
    "events": {
      "change_face": {
        "sequence": [
          {
            "condition": "query.block_property('block:face') == 1 && query.get_equipped_item_name == 'carrot'",
            "set_block_property": {
              "block:face": 2
            }
          },
          {
            "condition": "query.block_property('block:face') == 2 && query.get_equipped_item_name == 'carrot'",
            "set_block_property": {
              "block:face": 3
            }
          },
          {
            "condition": "query.block_property('block:face') == 3 && query.get_equipped_item_name == 'carrot'",
            "set_block_property": {
              "block:face": 4
            }
          },
          {
            "condition": "query.block_property('block:face') == 4 && query.get_equipped_item_name == 'carrot'",
            "set_block_property": {
              "block:face": 1
            }
          }
        ]
      },
      "select_rotation": {
        "sequence": [
          {
            "condition": "query.block_neighbor_has_any_tag(0,-1,0,'darkgato:rotation2')",
            "set_block_property": {
              "block:rotation": 2
            }
          },
          {
            "condition": "query.block_neighbor_has_any_tag(0,-1,0,'darkgato:rotation3')",
            "set_block_property": {
              "block:rotation": 3
            }
          },
          {
            "condition": "query.block_neighbor_has_any_tag(0,-1,0,'darkgato:rotation4')",
            "set_block_property": {
              "block:rotation": 4
            }
          },
          {
            "condition": "query.block_neighbor_has_any_tag(0,-1,0,'darkgato:rotation5')",
            "set_block_property": {
              "block:rotation": 5
            }
          }
        ]
      }
    }
  }
}