# Configuration

# Format

All configuration files of KingdomCraft, and many other plugins use the **YAML** format. You can recognise this on the **.yml** extension of a file such as **config.yml**.

To make sure a computer can read and understand these files you need to follow some rules.

* If you put **text** you need to put it between single quotes like this: `'Dit is een tekst'`
* You can **never** use tabs, always use spaces!
* Everything that starts with `#` are comments, the computer will ignore this.

**Example**

```yaml
settings:
  respawn-at-kingdom: true

  messages:
    # This message is broadcasted when someone joins the server
    join: '&e{kingdom_prefix}{rank_prefix}{player} &ejoined the server.'
```

You see the usage of **true** and **false** this is computer language for **yes** and **no** respectively.


# Config options

## Language

```javascript
language: 'nl'
```

Change the language, this must be the filename (without .yml) of the translation file in the language directory.

## Command aliases

```javascript
command-aliases: [k, kd, kdc, kingdom]
```

Change the command aliases, do you want /team instead of /kingdom? You can change that here!

## Remap commands

```yaml
remap-commands:
  'ranks list': 'ranklist'
```

This remaps **sub**commands to something else, in the above example `/k ranks list` is remapped to  `/k ranklist`. If you want to change the root command (the `/k` part) you can use [command aliases](https://wiki.guflimc.com/doc/configuration-DMcGaWt85O#h-command-aliases).

## Nokingdom

```javascript
nokingdom:
  display: '&eHobo'
  prefix: '&7[&eHobo&7]'
  suffix: ''
```

With this you can change the display, chat prefix and chat suffix for players without a kingdom. This affects the placeholders **display**, **kingdom_prefix** and **kingdom_suffix**.

With the following permission, the placeholders do not get replaced and will appear blank: `kingdom.placeholders.empty-no-kingdom`

## Friendly-fire

```javascript
friendly-fire: false
```

Enable (true) or disable (false) that members of the same kingdom can damage eachother.

## Friendly-fire relationships

```javascript
friendly-fire-relationships:
- ally
- truce
```

If you have this releationship with another kingdom the above rule **friendly-fire** also applies.

## Respawning

```javascript
respawn-at-kingdom: true
```

Teleport to your kingdom spawn when you die.

## Teleport delay

```javascript
teleport-delay: 5
```

Place a delay on teleporting commands such as /k spawn to prevent teleporting during a fight.

## Events

```javascript
events:
  kingdom-join:
  - CONSOLE k spawn {player}
  - CONSOLE clearninv {player}

  kingdom-leave:
  - CONSOLE k spawn {player}
  - CONSOLE clearninv {player}

  kingdom-create:
  - lp creategroup {kingdom_name}

  kingdom-delete:
  - lp deletegroup {kingdom_name}
```

Here you can put commands which are automatically executed on a specific event.

With `CONSOLE` this command is executed in the console. If you don't use this, the command is executed as the player, which means the player needs the correct permissions.

## Messages

```javascript
messages:
  join: '&e{kingdom_prefix}{rank_prefix}{player} &ejoined the server.'
  leave: '&e{kingdom_prefix}{rank_prefix}{player} &equit the server.'
  death: '&e{kingdom_prefix}{rank_prefix}{player} &edied.'
  kill: '&e{kingdom_prefix}{rank_prefix}{player} &ewas killed by
          {killer_kingdom_prefix}{killer_rank_prefix}{killer_player}&e.'
  kill-weapon: '&e{kingdom_prefix}{rank_prefix}{player} &ewas killed by 
          {killer_kingdom_prefix}{killer_rank_prefix}{killer_player} &ewith weapon {weapon}&e.'
```

Change the messages of events such as joining or quitting the server, dying or killing someone.


To only show the join and quit messages for players of your own kingdom, set this option to `true`.

```javascript
join-and-leave-kingdom-only: false
```

## Date format

```javascript
timezone: 'Europe/Brussels'
date-format: 'yyyy-MM-dd'
time-format: 'HH:mm'
```

The timezone, date format and time format to be used for displaying dates and times.

## Update display names

```javascript
update-display-names: true
```

Change the display name of players (like essentials nicknames) with the kingdom prefix & suffix. Use this together with Dynmap for colored names on the map! This does not work well together with other plugins such as essentials because of their nickname system.

---

**Documents**

- [Getting started](https://wiki.guflimc.com/s/kingdomcraft/doc/getting-started-D6nO7R93ys)
- [Configuration](https://wiki.guflimc.com/s/kingdomcraft/doc/configuration-DMcGaWt85O)
- [Kingdom setup](https://wiki.guflimc.com/s/kingdomcraft/doc/kingdom-setup-ZDcgXrOKXu)
- [Ranks setup](https://wiki.guflimc.com/s/kingdomcraft/doc/ranks-setup-8ZxHwOcwuN)
- [Players guide](https://wiki.guflimc.com/s/kingdomcraft/doc/players-guide-52cG3r3F9w)
- [Chat system](https://wiki.guflimc.com/s/kingdomcraft/doc/chat-system-BI5h4CO5nK)
- [Relations](https://wiki.guflimc.com/s/kingdomcraft/doc/relations-DWqWWHEum8)
- [Admin mode](https://wiki.guflimc.com/s/kingdomcraft/doc/admin-mode-XiPDZwgCU9)
- [Translations](https://wiki.guflimc.com/s/kingdomcraft/doc/translations-P1RH2hwYjp)
- [Rank permissions](https://wiki.guflimc.com/s/kingdomcraft/doc/rank-permissions-pJn6oSjLYI)
- [All permissions](https://wiki.guflimc.com/s/kingdomcraft/doc/all-permissions-abZLW9OAkb)
- [Database](https://wiki.guflimc.com/s/kingdomcraft/doc/database-XlNdVs86Jz)