aboutsummaryrefslogtreecommitdiff
path: root/Writerside/topics/config-file.md
blob: 2419406a7f695534dca55bc46784de062c61de26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Config file

On top of the gamerules, you can edit a config file, named `molehunt.properties`. 
This file is automatically generated when starting a server with the mod installed.

This file will set the default settings when creating a new world, but that's it.
You will still be able to change the gamerules. Editing this file is recommended
when you plan on having multiple molehunt games with the same settings but on
different worlds.

> If you only want to change the settings on a single world, or don't want to change
> a lot, I would suggest [playing with the gamerules](gamerules.md) rather than the config
> file, as it is easier and directly in-game
{style=note}


## Editing the config file

You can find the `molehunt.properties` file in your server's `config` folder.
If it is not present, make sure the mod is installed, and start your server.

Every setting available in the config file reflects a gamerule (they have very
similar names). To know what each setting does, you can check [the gamerules documention](gamerules.md).

The config syntax is very simple :
- `name_of_the_setting = value` to set a setting to a `value`. Only one setting 
  can be set on a single line
- A line starting with a `#` is a comment, and will not be counted be the mod. 


## Troubleshooting the config file

If you realise the config file isn't being applied correctly, check these potential
solutions before making an issue on GitHub.

### Checking the file location

Make sure the config file you're editing is located in your server's `config` directory,
and that the file's name is `molehunt.properties`.

### Make sure the syntax is correct

A comment line starts with a `#`, not with `//` nor with anything else.

Also, you can only set one variable on one line. For exemple, this is incorrect :
```yaml
# This is not a valid config file
first_setting = 1    second_setting = 2
# The value must also be on the same line as the setting name. This is incorrect :
another_setting =
3
```

### Make sure the setting have the right value type

A boolean value (one that can either be "on or off") can be set to `true` or `false`,
nothing else.
```yaml
# Good
my_boolean = true

# Bad
my_boolean = false
```

Every numerical value should be integers: there are no decimal values in this mod. 
And you should not put the unit after the value (do not put `50 blocks`, but only `50`).

> If you have checked everything, and there's still a problem, don't hesitate to
> create a new issue on GitHub, **if no existing issue match you problem**.

## Default configuration

Here is the default configuration that is automatically generated. Every setting 
is listed below.

To regenerate the default configuration, you can rename, move or delete your 
current config file, and then run the server with the mod installed. 

```yaml
# Molehunt mod configuration file
# To regenerate the default configuration, delete, move or rename this file.

# Game settings

# The duration of a molehunt game, in minutes.
# Default: 90 minutes (1 hour 30 minutes).
game_duration = 90

# Mole percentage.
# For example, a mole percentage of 25% will get 1 mole every 4 players.
# Default: 25 %.
mole_percentage = 25

# Mole count (absolute).
# This setting will overwrite the mole_percentage setting.
# If set below 0, this setting is disabled.
# Default: -1.
mole_count = -1


# Client-side settings (applies to all players)

# Show nametags
# Default: false
show_nametags = false

# Show skins
# Default: false
show_skins = false

# Show tab
# Default: false
show_tab = false


# World border settings

# Initial world size (in blocks).
# Default: 200 blocks.
initial_world_size = 200

# Final world size (in blocks).
# Default: 50 blocks.
final_world_size = 50

# Moving starting time offset (in minutes)
# The time before starting to move the world borders.
# If this value is greater than the game duration, borders will never move.
# Default: 10 minutes.
border_moving_starting_time_offset = 10

# Other

# Enable portals (nether, end, end gateway)
# Default: false
enable_portals = false
```