{
  "format_version": "1.21.0",
  "minecraft:entity": {
    "description": {
      "identifier": "mdrb:elevator_mdrb",
      "spawn_category": "creature",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "properties": {
        "md:open": {
          "type": "bool",
          "default": true,
          "client_sync": true
        },
        "md:move": {
          "type": "enum",
          "values": ["none","up","down"],
          "default": "none",
          "client_sync": true
        }
      }
    },
    "component_groups": {
      "ride_default": {
        "minecraft:rideable": {
          "seat_count": 1,
          "seats": [
            {
              "position": [ -1.5, 2.5, 1.6 ]
            }
          ]
        }
      },
      "add_button": {
        "minecraft:addrider": {
          "entity_type": "mdrb:elevator_button_mdrb"
        }
      },
      "placed": {
        "minecraft:collision_box": {
          "width": 3.8,
          "height": 1
        }
      },
      "ride_1": {
        "minecraft:rideable": {
          "seat_count": 1,
          "seats": [
            {
              "position": [ 0, 1.4, 0 ]
            }
          ]
        }
      },
      "ride_2": {
        "minecraft:rideable": {
          "seat_count": 2,
          "seats": [
            {
              "position": [ 1, 1.4, 0 ]
            },
            {
              "position": [ -1, 1.4, 0 ]
            }
          ]
        }
      },
      "ride_3": {
        "minecraft:rideable": {
          "seat_count": 3,
          "seats": [
            {
              "position": [ 0, 1.4, 0 ]
            },
            {
              "position": [ 1, 1.4, -0.5 ]
            },
            {
              "position": [ -1, 1.4, -0.5 ]
            }
          ]
        }
      },
      "ride_4": {
        "minecraft:rideable": {
          "seat_count": 4,
          "seats": [
            {
              "position": [ 1, 1.4, 1 ]
            },
            {
              "position": [ -1, 1.4, 1 ]
            },
            {
              "position": [ 1, 1.4, -1 ]
            },
            {
              "position": [ -1, 1.4, -1 ]
            }
          ]
        }
      },
      "ride_5": {
        "minecraft:rideable": {
          "seat_count": 5,
          "seats": [
            {
              "position": [ 0, 1.4, 0 ]
            },
            {
              "position": [ 1, 1.4, 1 ]
            },
            {
              "position": [ -1, 1.4, 1 ]
            },
            {
              "position": [ 1, 1.4, -1 ]
            },
            {
              "position": [ -1, 1.4, -1 ]
            }
          ]
        }
      },
      "ride_6": {
        "minecraft:rideable": {
          "seat_count": 6,
          "seats": [
            {
              "position": [ 1, 1.4, 1 ]
            },
            {
              "position": [ 1, 1.4, 0 ]
            },
            {
              "position": [ 1, 1.4, -1 ]
            },
            {
              "position": [ -1, 1.4, 1 ]
            },
            {
              "position": [ -1, 1.4, 0 ]
            },
            {
              "position": [ -1, 1.4, -1 ]
            }
          ]
        }
      }
    },
    "components": {
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "all",
          "deals_damage": false
        }
      },
      "minecraft:type_family": {
        "family": [ "elevator", "md" ]
      },
      "minecraft:collision_box": {
        "width": 0.8,
        "height": 1
      },
      "minecraft:physics": {
        "has_gravity": false,
        "has_collision": false
      },
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": false
      },
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player"
                  },
                  {
                    "test": "has_equipment",
                    "domain": "hand",
                    "subject": "other",
                    "value": "md:md_tool"
                  }
                ]
              }
            },
            "interact_text": "Setting"
          }
        ]
      },
      "minecraft:is_collidable": {},
      "minecraft:knockback_resistance": {"value": 9},
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "add" : { "component_groups": ["ride_default","add_button"] },
        "queue_command" : { "command": ["scriptevent md:elevator"] }
      },
      "add_button": {
        "add" : { "component_groups": ["add_button"] }
      },
      "ride_default": {
        "remove" : { "component_groups": ["ride_1","ride_2","ride_3","ride_4","ride_5","ride_6"] },
        "add" : { "component_groups": ["ride_default"] }
      },
      "placed": {
        "add" : { "component_groups": ["placed"] }
      },
      "ride_1": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_1"] }
      },
      "ride_2": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_2"] }
      },
      "ride_3": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_3"] }
      },
      "ride_4": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_4"] }
      },
      "ride_5": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_5"] }
      },
      "ride_6": {
        "remove" : { "component_groups": ["ride_default"] },
        "add" : { "component_groups": ["ride_6"] }
      }
    }
  }
}