# Configuration

## Lobby Side

### Configuration File

{% hint style="warning" %}
Server names must be consistent: you need a general prefix like "bedwars" and a distinction between lobby servers and match servers. \
\
Example: \
\- bedwars-lobby-1\
\- bedwars-lobby-2\
\- bedwars-instance-1\
\- bedwars-instance-2
{% endhint %}

{% code title="config.yml" fullWidth="false" %}

```yaml
pixel:
  leader: true
  server-prefix:
    generic: "bedwars-"
    lobby: "bedwars-lobby-"
    instance: "bedwars-instance-"
  servers:
    dynamically-start: false
    max-servers: 1
  matches:
    per-server: 30
    warning-percentage: 60
```

{% endcode %}

<mark style="color:red;">`pixel.leader`</mark> when there are multiple lobbies activate it only in one of them.\
\ <mark style="color:red;">`pixel.server-prefix.generic`</mark> generic server mode prefix. Example "bedwars"\ <mark style="color:red;">`pixel.server-prefix.lobby`</mark> lobby server prefix\ <mark style="color:red;">`pixel.server-prefix.instance`</mark> instance server prefix\
\ <mark style="color:red;">`pixel.servers.dynamically-start`</mark> enable if you are using Cerebrum\ <mark style="color:red;">`pixel.servers.max-servers`</mark> maximum number of match servers (when using cerebrum)\
\ <mark style="color:red;">`pixel.matches.per-server`</mark> maximum number of matches per server\ <mark style="color:red;">`pixel.matches.warning-percentage`</mark> percentage of matches (-> servers) occupied to start other servers (when using cerebrum)

```yaml
permissions:
  map-limit:
    - bedwars.map.unlimited
    - bedwars.map.4
    - bedwars.map.2
    - bedwars.map.1
```

Defines permissions for the number of daily map choices

### Add a configured Arena

The configured arena files need to be inserted into the "arenas" folder. Based on the type, insert the file in the respective folder ("solo" -> "1", "duo" -> "2", "trio" -> "3", "squad" -> "4").

&#x20;[arena](https://docs.ohalee.com/products/ultimatebedwars/arena "mention")

### Placeholders

type: \[ solo, doubles, trio, squad ]

<mark style="color:red;">`%bw_online_<type>%`</mark> -> return the online players for that specified type

Statistics: \[ bed, kills, finalkills, death, finaldeaths, losses, wins, winstreak ] \
Period: \[ daily, weekly, alltime ]\
Positions: \[ 1..10 ]

<mark style="color:red;">`%bw_board_<statistic>_<period>_<position>%`</mark>

Statistics: \[ bed, kills, finalkills, death, finaldeaths, losses, wins, winstreak, total\_played, kd\_ratio ]\
Scope: \[ solo, doubles, trio, squad, *global -> empty (bw\_\<statistic>)* ]

<mark style="color:red;">`%bw_<scope>_<statistic>%`</mark> -> return the player's statistic

### Leaderboards

an example of a leaderboard with DecentHolograms

<details>

<summary>top_wins.yml</summary>

```yaml
location: world:20.5:67.4:-26.2 #Modify the coords
enabled: true
display-range: 48
update-range: 48
update-interval: 40
facing: 0.0
down-origin: false
pages:
- lines:
  - content: '&d&lWins'
    height: 0.3
  - content: ''
    height: 0.3
  - content: '&e1. &b%bw_board_wins_alltime_1%'
    height: 0.3
  - content: '&e2. &b%bw_board_wins_alltime_2%'
    height: 0.3
  - content: '&e3. &b%bw_board_wins_alltime_3%'
    height: 0.3
  - content: '&e4. &b%bw_board_wins_alltime_4%'
    height: 0.3
  - content: '&e5. &b%bw_board_wins_alltime_5%'
    height: 0.3
  - content: '&e6. &b%bw_board_wins_alltime_6%'
    height: 0.3
  - content: '&e7. &b%bw_board_wins_alltime_7%'
    height: 0.3
  - content: '&e8. &b%bw_board_wins_alltime_8%'
    height: 0.3
  - content: '&e9. &b%bw_board_wins_alltime_9%'
    height: 0.3
  - content: '&e10. &b%bw_board_wins_alltime_10%'
    height: 0.3
  - content: '&7'
    height: 0.3
  - content: '&6&lClick Here'
    height: 0.3
  - content: '&7Daily - Weekly - &a&lLifetime'
    height: 0.3
  actions:
    RIGHT:
    - NEXT_PAGE:top_wins
- lines:
  - content: '&d&lDaily Wins'
    height: 0.3
  - content: ''
    height: 0.3
  - content: '&e1. &b%bw_board_wins_daily_1%'
    height: 0.3
  - content: '&e2. &b%bw_board_wins_daily_2%'
    height: 0.3
  - content: '&e3. &b%bw_board_wins_daily_3%'
    height: 0.3
  - content: '&e4. &b%bw_board_wins_daily_4%'
    height: 0.3
  - content: '&e5. &b%bw_board_wins_daily_5%'
    height: 0.3
  - content: '&e6. &b%bw_board_wins_daily_6%'
    height: 0.3
  - content: '&e7. &b%bw_board_wins_daily_7%'
    height: 0.3
  - content: '&e8. &b%bw_board_wins_daily_8%'
    height: 0.3
  - content: '&e9. &b%bw_board_wins_daily_9%'
    height: 0.3
  - content: '&e10. &b%bw_board_wins_daily_10%'
    height: 0.3
  - content: '&7'
    height: 0.3
  - content: '&6&lClick Here'
    height: 0.3
  - content: '&a&lDaily &7- Weekly - Lifetime'
    height: 0.3
  actions:
    RIGHT:
    - NEXT_PAGE:top_wins
- lines:
  - content: '&d&lWeekly Wins'
    height: 0.3
  - content: ''
    height: 0.3
  - content: '&e1. &b%bw_board_wins_weekly_1%'
    height: 0.3
  - content: '&e2. &b%bw_board_wins_weekly_2%'
    height: 0.3
  - content: '&e3. &b%bw_board_wins_weekly_3%'
    height: 0.3
  - content: '&e4. &b%bw_board_wins_weekly_4%'
    height: 0.3
  - content: '&e5. &b%bw_board_wins_weekly_5%'
    height: 0.3
  - content: '&e6. &b%bw_board_wins_weekly_6%'
    height: 0.3
  - content: '&e7. &b%bw_board_wins_weekly_7%'
    height: 0.3
  - content: '&e8. &b%bw_board_wins_weekly_8%'
    height: 0.3
  - content: '&e9. &b%bw_board_wins_weekly_9%'
    height: 0.3
  - content: '&e10. &b%bw_board_wins_weekly_10%'
    height: 0.3
  - content: '&7'
    height: 0.3
  - content: '&6&lClick Here'
    height: 0.3
  - content: '&7Daily - &a&lWeekly &7- Lifetime'
    height: 0.3
  actions:
    RIGHT:
    - PAGE:top_wins:1
```

</details>

***

## Instance Side

{% hint style="info" %}
Check that the "server.id" property in the BasementLib config is correctly configured.

See [Broken link](https://docs.ohalee.com/products/ultimatebedwars/broken-reference "mention")
{% endhint %}

Files:

* config.yml -> Main configurations
* language.yml -> Files for translations
* sounds.yml -> Customize Sounds
* shop2.yml -> Villager Shop (Solo and Duo)
* shop4.yml -> Villager Shop (Trio and Squad)
* upgrades2.yml -> Upgrades Shop (Solo and Duo)
* upgrades4.yml -> Upgrades Shop (Trio and Squad)

### Configuration File

{% code title="config.yml" %}

```yaml
pixel:
  server-prefix:
    lobby: "bedwars-lobby-"

game-events:
  GAME_START_REGULAR: 40
  NEXT_EVENT_BEDS_DESTROY: 300
  NEXT_EVENT_DRAGON_SPAWN: 300
  NEXT_EVENT_GAME_END: 120

xp:
  final-kill:
    enabled: true
    amount: 30
    name: "Final Kill"
  victory:
    enabled: true
    amount: 100
    name: "Victory"
  bed-destroy:
    enabled: true
    amount-2: 20
    amount-4: 40
    name: "Bed Destroyed"

generators:
  types:
    SLOW:
      IRON_DELAY: 20
      GOLD_DELAY: 60
    NORMAL:
      IRON_DELAY: 10
      GOLD_DELAY: 40
    FAST:
      IRON_DELAY: 5
      GOLD_DELAY: 20
    TURBO:
      IRON_DELAY: 2
      GOLD_DELAY: 10
  IRON_AMOUNT: 1
  IRON_SPAWN_LIMIT: 30
  GOLD_AMOUNT: 1
  GOLD_SPAWN_LIMIT: 7
  DIAMOND_TIERI_DELAY: 300
  DIAMOND_TIERI_SPAWN_LIMIT: 2
  DIAMOND_TIERII_DELAY: 200
  DIAMOND_TIERII_SPAWN_LIMIT: 4
  DIAMOND_TIERII_START: 180
  DIAMOND_TIERIII_DELAY: 150
  DIAMOND_TIERIII_SPAWN_LIMIT: 6
  DIAMOND_TIERIII_START: 540
  EMERALD_TIERI_DELAY: 700
  EMERALD_TIERI_SPAWN_LIMIT: 2
  EMERALD_TIERII_DELAY: 500
  EMERALD_TIERII_SPAWN_LIMIT: 4
  EMERALD_TIERII_START: 360
  EMERALD_TIERIII_DELAY: 300
  EMERALD_TIERIII_SPAWN_LIMIT: 4
  EMERALD_TIERIII_START: 720
```

{% endcode %}

<mark style="color:red;">`pixel.server-prefix.lobby`</mark> The generic prefix for all lobbies: following the example above -> bedwars-instance-

### World Maps

{% hint style="info" %}
UltimateBedwars is compatible with SlimeWorldManager, a plugin that greatly optimizes world management. In this case you will only need to have the \<world\_name>.slime file uploaded to MongoDB.

File name in lower case and consistent with the file name of its configuration in the lobby.
{% endhint %}

Map worlds must be created in each server instance.

Inside the plugin folder there is a "maps" folder. Inside "maps" insert all the world folders. The name of the folder must match that of the respective configuration file inserted in the lobby, only that here the world folder must be in lower case.

<figure><img src="https://380370104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEOWHARTcYfCelyEDnKoW%2Fuploads%2FM13LSQaVIXxhgYT9cuLg%2Fimage.png?alt=media&#x26;token=4a3daa2d-f76f-44db-a518-4dd92bd9e973" alt=""><figcaption><p>Following the example of the already configured arena.</p></figcaption></figure>

<figure><img src="https://380370104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEOWHARTcYfCelyEDnKoW%2Fuploads%2FsaUA3m2p6Gc4LJoDKESn%2Fimage.png?alt=media&#x26;token=fe270aaf-02a3-4b97-b0f2-212f4a3a799f" alt=""><figcaption><p>Inside the folder there are directly the world files</p></figcaption></figure>

***

## Proxy Side

{% code title="mysql.json" %}

```json
{
  "host": "localhost",
  "username": "root",
  "password": "",
  "database": "minecraft",
  "minPoolSize": 5,
  "maxPoolSize": 5
}
```

{% endcode %}

{% code title="redis.json" %}

```json
{
  "hosts": [
    "localhost"
  ],
  "username": "",
  "password": "",
  "database": 0,
  "nettyThreads": 32,
  "threads": 16
}
```

{% endcode %}

Party configuration avaible in all server.

{% code title="party.json" %}

```json
{
  "prefix": "&d&lParty &8&l› &7",
  "commands": {
    "main": "party",
    "aliases": ["p"],
  },
  "errors": {
    "no-permission": "You do not have permission to execute this command.",
    "player-not-found": "Player not found",
    "already-in-party": "You are already in a party.",
    "not-in-party": "You must be in a party to execute this command!",
    "player-in-party": "This player is already in a party.",
    "player-not-in-party": "This player is not in a party.",
    "player-not-leader": "You are not the leader of the party.",
    "party-full": "The party is full.",
    "player-cannot-himself": "You cannot perform this action on yourself."
  },
  "invite": {
    "revoked": "&b{player} &7has revoked the invite of &a{invited}",
    "sent": "&b{player} &7has invited &a{invited} &7to the party.",
    "player-notify": "&b{player} &7has invited you to the party &a(Click Here)",
    "description": "&8&l› &b/party invite <player> &eInvite a player."
  },
  "join": {
    "player-not-invited": "You have not been invited to the party.",
    "success": "&b{player} &7has joined the party",
    "success-notify": "&7You have joined the party of &a{leader}&7.",
    "description": "&8&l› &b/party join <player> &eJoin another user's party."
  },
  "leave": {
    "success": "&b{player} &7has left the party",
    "success-notify": "&7You have left the party",
    "description": "&8&l› &b/party leave &eLeave the party."
  },
  "kick": {
    "success": "&b{player} &7has kicked &b{target}",
    "success-notify": "You have been kicked from the party",
    "description": "&8&l› &b/party kick <player> &eKick a player from the party."
  },
  "list": {
    "leader-line": "&7Leader: &a{leader} &7(&e{memberCount}&7)",
    "member-line": "&7Members: &b{members}",
    "member-joiner": "&7, &b",
    "description": "&8&l› &b/party list &eView players in the party."
  },
  "leader": {
    "success": "&b{player}&7 has appointed &a{leader} as the leader.",
    "description": "&8&l› &b/party leader <player> &eChange the leader."
  },
  "open": {
    "open": "Party opened!",
    "close": "Party closed!",
    "description": "&8&l› &b/party open &eMake the party public."
  },
  "disband": {
    "success": "&cYour party has been disbanded"
  },
  "help": {
    "header": "&8&m-------------------&a&l PARTY &8&m-------------------",
    "footer": "&8&m---------------------------------------------"
  }
}
```

{% endcode %}
