{
  "format_version": "1.18.0",
  "minecraft:entity": {
    "description": {
      "identifier": "mq:switch",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "remove": {
        "minecraft:instant_despawn": {
          "remove_child_entities": true
        }
      },
      "transformation": {
        "minecraft:transformation": {
          "into": "mq:setting",
          "transformation_sound": ""
        }
      }
    },
    "components": {
      "minecraft:type_family": {
        "family":["mq", "switch"]
      },
      "minecraft:interact": {
        "interactions": [{
          "on_interact": {
            "filters": {
              "all_of": [{
                "test": "is_family", "subject" : "other", "value" : "player"
              },
                {
                  "test": "is_sneaking", "subject": "other"
                }]
            },
            "event": "use",
            "target": "self"
          },
          "play_sounds": "pop",
          "interact_text": "开关"
        }]
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "all",
          "deals_damage": false
        }
      },
      "minecraft:collision_box": {
        "width": 0,
        "height": 0
      },
      "minecraft:health": {
        "value": 1,
        "max": 1,
        "min": 1
      },
      "minecraft:physics": {}
    },
    "events": {
      "minecraft:entity_spawned": {},
      "transformation": {
        "add": {
          "component_groups": [
            "transformation"
          ]
        }
      },
      "remove": {
        "add": {
          "component_groups": [
            "remove"
          ]
        }
      },
      "use": {
        "run_command": {
          "command": "tag @s add use",
          "target": "other"
        }
      }
    }
  }
}