# Config & Command

### Commands

1. `/mmoupgrade admin reload` This command **reloads the plugin** if you've modified the plugin's configuration files.
2. `/mmoupgrade upgrade <file name>` This command **opens the Upgrade GUI** that you've created, found in the `upgrade` folder.
3. `/mmoupgrade gem <file name>` This command **opens the Gem Add Socket GUI** that you've created, found in the `gem` folder.
4. `/mmoupgrade repair <file name>` This command **opens the Repair GUI** that you've created, found in the `repair` folder.

### Config

**1. Dynamic Configuration**

You can configure `.yml` files as needed to achieve unique GUI functionalities.

<figure><img src="https://1245303946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEMKTTfYtO1c14jr3rkcH%2Fuploads%2FbYSnUsIUMjNw9y5UsW5y%2Fimage.png?alt=media&#x26;token=10fb3d58-e5c0-4080-a387-64189448063f" alt=""><figcaption><p>Config</p></figcaption></figure>

***

#### 2. GUI Design

Customize the GUI to your liking, including slot adjustments and support for Custom Model Data.

```yaml
# GUI customization
gui:
  title: "&bSword Upgrade Station" # GUI title
  rows: 6 # GUI rows (1-6)
  slots:
    item: 13 # Slot for the item to upgrade
    material: 21 # Slot for upgrade material
    protection: 23 # Slot for protection material
    success-stone: 22 # Slot for success rate boost material (if enabled)
    confirm:
      material: GREEN_STAINED_GLASS_PANE # Confirm button material
      name: "&a&lConfirm Upgrade" # Confirm button name
      lore: # Confirm button lore
        - "&7Click to upgrade"
        - "&7Just click it! {rate}"
        - "Material: {material}"
        - "Cost: {cost}"
      slot: 40 # Confirm button slot
      cmd: 1 # Custom Model Data (if any)
    filter:
      name: "&f" # Filter name (not displayed)
      material: BLACK_STAINED_GLASS_PANE # Filter material
      cmd: 1 # Custom Model Data (if any)
```

***

#### 3. Text and Sound

Customize text and sounds as you desire, with support for RGB Colors and Minecraft Color Codes.

```yaml
# Sound settings
# https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
sounds:
  upgrade-success: ENTITY_EXPERIENCE_ORB_PICKUP # Sound on successful upgrade
  upgrade-fail: BLOCK_ANVIL_DESTROY # Sound on failed upgrade
  confirm-no-item: BLOCK_NOTE_BLOCK_PLING # Sound when confirming with no item
```

```yaml
Supports RGB and standard color codes.
1.RGB = &#ffffff
2.Standard = &f
https://www.birdflop.com/resources/rgb/
```

```yaml
messages:
  gui:
    not-enough-money: "need {cost} for upgrade item"
    wrong-item: "Incorrect item!"
    wrong-upgrade-item: "This item cannot be upgraded"
    required-material-item: "Please place {amount} {material_name} in the Material slot."
    place-an-item-in-slot: "Place the item you want to upgrade before pressing Confirm"
    destroy-item-upgrade: "Destroy Item."
  upgrade:
    level-to-zero-upgrade: "Upgrade failed! Reset to level 0"
    level-up-upgrade: "&aUpgrade successful! New level: &e{level}"
    level-down-upgrade: "Upgrade failed! Item level decreased"
    level-fail-upgrade:
      - "&c------------------------"
      - "&cUPGRADE FAILED!"
      - "&7Your item did not upgrade."
      - "&c------------------------"
    level-fail-protection-upgrade: "Upgrade failed, but item was protected"
    error-upgrade-template: "An error occurred during upgrade"
    level-max-upgrade-item: "Upgrade reached maximum level"
    no-upgrade-template-item: "This item has no upgrade template"
    wrong-upgrade-item: "This item cannot be upgraded"
    place-an-item-in-slot: "Place the item you want to upgrade before pressing Confirm"
  gem-add-socket:
    max-reached: "max-reached"
    socket-added: "Successfully added a Gem slot!"
    socket-add-failed: "Failed to add a socket"
    invalid-mmoitem: "This item is not a valid MMOItem!"
    invalid-item-type: "This item type cannot have Gem slots added."
    error-add-socket: "An error occurred while adding a Gem slot: {error}"
    cannot-add-sockets: "This item cannot have Gem slots added. Please check the type."
    invalid-item: "Invalid item"
    no-money: "You don't have Cost: ({cost})"
    required-material-item: "required Steel Ingot 1ea"
  repair:
    invalid-slots: "Invalid item slot(s)."
    insufficient-funds: "You do not have enough money (requires {cost})."
    success: "Item(s) repaired."
    no-items-repaired: "No items were repaired."
    cancel-item: "&cYou can only place items in the repair slot."
```

***

#### 4. Permissions

You can define **permissions** for each GUI. If a user doesn't have the necessary permission, they won't be able to open that GUI.

```yaml
settings:
  permission: nwmmoupgrade.upgrade.sword
```
