# Configuring Motels

The Motels plugin offers two primary methods for configuring and managing motels: direct editing of the `motel.yml` file and using MotelAdmin commands. Both methods are powerful and can be used based on your preference and specific needs.

### Using MotelAdmin Commands

The plugin provides several administrative commands that allow you to manage motels without directly editing the configuration file. These commands are particularly useful for in-game management and quick changes.

#### Key MotelAdmin Commands for Motel Configuration:

1. **Adding a New Motel**:

   ```
   /moteladmin add <regionId> <price> <displayName>
   ```

   This command creates a new motel with the specified WorldGuard region ID, price, and display name.
2. **Setting Motel Location**:

   ```
   /moteladmin set-location <motelRegionId>
   ```

   Sets the teleport location for the specified motel to your current position.
3. **Changing Motel Type**:

   ```
   /moteladmin change-type <motelId> <type>
   ```

   Changes the type of the motel (rent or permanent).
4. **Setting Expiration Date**:

   ```
   /moteladmin set-expiration-date <motelId> <day> <month> <year>
   ```

   Manually sets the expiration date for a rented motel.
5. **Changing Display Name**:

   ```
   /moteladmin set-displayname <motelId> <displayName>
   ```

   Changes the display name of an existing motel.
6. **Removing a Motel**:

   ```
   /moteladmin remove <motelRegionId>
   ```

   Removes an existing motel from the system.

These commands automatically update the `motel.yml` file, ensuring consistency between in-game changes and the configuration file.

### Manual Configuration in motel.yml

While the MotelAdmin commands are convenient, you can also manually edit the `motel.yml` file for more detailed configurations or batch edits.

#### Basic Structure of motel.yml:

```yaml
motel:
  [motel-id]:
    displayname: "[Room Name]"
    owner: "null"
    price: [price]
    expireDate: "null"
    type: [rent/permanent]
    visitable: [true/false]
    location:
      ==: org.bukkit.Location
      world: [world-name]
      x: [x-coordinate]
      y: [y-coordinate]
      z: [z-coordinate]
      pitch: [pitch]
      yaw: [yaw]
    actions:
      buy:
        - [command1]
        - [command2]
      sell:
        - [command1]
        - [command2]
```

#### Adding a New Motel Manually:

To add a new motel room in `motel.yml`:

1. Choose a unique `[motel-id]` (e.g., `motel-1-101`).
2. Add the new motel section with all necessary properties.
3. Save the file and reload the plugin using `/moteladmin reload`.

### Best Practices

1. **Use MotelAdmin Commands** for quick, in-game changes and management.
2. **Edit motel.yml Directly** for bulk changes or detailed configurations.
3. Always **reload the plugin** after manual edits to `motel.yml`.
4. Maintain a **consistent naming convention** for motel IDs.
5. Use **color codes** in display names for attractive presentation.
6. Be cautious with **action commands**; they run with console permissions.

By combining both MotelAdmin commands and manual configuration, you can efficiently manage and customize your server's motel system to fit your specific needs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anotherlevel.it/documentation/motels/configuring-motels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
