{
  "format_version": "1.20.10",
  "minecraft:item": {
    "description": {
      "category": "items",
      "identifier": "rc:wrench"
    },
    "components": {
      "minecraft:icon": {
        "texture": "wrench"
      },
      "minecraft:display_name": {
        "value": "Wrench"
      },
      "minecraft:creative_category": {
        "parent": "itemGroup.name.items"
      },
      "minecraft:on_use_on": {
        "on_use_on": {
          "event": "use",
          "target": "self"
        }
      },
      "minecraft:max_stack_size": 1,
      "minecraft:hand_equipped": true
    },
    "events": {
      "use": {
        "sequence": [
          {
            "condition":"query.block_face != 1",
            "run_command": {
              "command": ["execute as @p at @s run scriptevent rc:wrench"]
            }
          },
          {
            "condition":"query.block_face == 1",
            "run_command": {
              "command": ["execute as @p at @s run scriptevent rc:wrench up"]
            }
          }
        ]
      }
    }
  }
}
