{
  "criteria": {
    "unoccupied": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:value_check",
              "value": {
                "type": "minecraft:score",
                "target": "this",
                "score": "smithed.actionbar.sneaking"
              },
              "range": {
                "min": 1
              }
            }
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.major"
              },
              "score": "load.status"
            },
            "range": 0
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.minor"
              },
              "score": "load.status"
            },
            "range": 2
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.patch"
              },
              "score": "load.status"
            },
            "range": 0
          }
        ],
        "location": {
          "dimension": "minecraft:overworld",
          "block": {
            "tag": "minecraft:beds",
            "state": {
              "occupied": false
            }
          }
        }
      }
    },
    "occupied": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:inverted",
            "term": {
              "condition": "minecraft:value_check",
              "value": {
                "type": "minecraft:score",
                "target": "this",
                "score": "smithed.actionbar.sneaking"
              },
              "range": {
                "min": 1
              }
            }
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.major"
              },
              "score": "load.status"
            },
            "range": 0
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.minor"
              },
              "score": "load.status"
            },
            "range": 2
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.patch"
              },
              "score": "load.status"
            },
            "range": 0
          }
        ],
        "location": {
          "dimension": "minecraft:overworld",
          "block": {
            "tag": "minecraft:beds",
            "state": {
              "occupied": true
            }
          }
        }
      }
    },
    "unoccupied_empty": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": "this",
              "score": "smithed.actionbar.sneaking"
            },
            "range": {
              "min": 1
            }
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.major"
              },
              "score": "load.status"
            },
            "range": 0
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.minor"
              },
              "score": "load.status"
            },
            "range": 2
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.patch"
              },
              "score": "load.status"
            },
            "range": 0
          }
        ],
        "item": {
          "items": [
            "minecraft:air"
          ]
        },
        "location": {
          "dimension": "minecraft:overworld",
          "block": {
            "tag": "minecraft:beds",
            "state": {
              "occupied": false
            }
          }
        }
      }
    },
    "occupied_empty": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": "this",
              "score": "smithed.actionbar.sneaking"
            },
            "range": {
              "min": 1
            }
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.major"
              },
              "score": "load.status"
            },
            "range": 0
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.minor"
              },
              "score": "load.status"
            },
            "range": 2
          },
          {
            "condition": "minecraft:value_check",
            "value": {
              "type": "minecraft:score",
              "target": {
                "type": "minecraft:fixed",
                "name": "#smithed.actionbar.patch"
              },
              "score": "load.status"
            },
            "range": 0
          }
        ],
        "item": {
          "items": [
            "minecraft:air"
          ]
        },
        "location": {
          "dimension": "minecraft:overworld",
          "block": {
            "tag": "minecraft:beds",
            "state": {
              "occupied": true
            }
          }
        }
      }
    }
  },
  "requirements": [
    [
      "unoccupied",
      "occupied",
      "unoccupied_empty",
      "occupied_empty"
    ]
  ],
  "rewards": {
    "function": "smithed.actionbar:v0.2.0/vanilla/bed/clicked_bed"
  }
}
