mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-11-10 02:37:09 +00:00
docs: Cleanup RCON_CMDS examples (#1526)
This commit is contained in:
1 parent
bc3c3db080
commit
f67d3948d2
1 file changed
+14
-12
@@ -1562,48 +1562,50 @@ To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The
|
|||||||
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
|
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use RCON commands
|
### Auto-execute RCON commands
|
||||||
|
|
||||||
Feature is used run commands when the server starts, client connects, or client disconnects.
|
RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects.
|
||||||
**Notes:**
|
|
||||||
* On client connect we only know there was a connection, and not who connected. RCON commands will need to be used for that.
|
> When declaring several commands within a compose file environment variable, it's easiest to use YAML's `|-` [block style indicator](https://yaml-multiline.info/).
|
||||||
* Using '|-' is preferred for yaml, this make sure only the correct new lines are in place for the commands.
|
|
||||||
|
|
||||||
**On Server Start:**
|
**On Server Start:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
RCON_CMDS_STARTUP: |-
|
RCON_CMDS_STARTUP: |-
|
||||||
/gamerule doFireTick false
|
gamerule doFireTick false
|
||||||
/pregen start 200
|
pregen start 200
|
||||||
```
|
```
|
||||||
|
|
||||||
**On Client Connection:**
|
**On Client Connection:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
RCON_CMDS_ON_CONNECT: |-
|
RCON_CMDS_ON_CONNECT: |-
|
||||||
/team join New @a[team=]
|
team join New @a[team=]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
* On client connect we only know there was a connection, and not who connected. RCON commands will need to be used for that.
|
||||||
|
|
||||||
**On Client Disconnect:**
|
**On Client Disconnect:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
RCON_CMDS_ON_DISCONNECT: |-
|
RCON_CMDS_ON_DISCONNECT: |-
|
||||||
/gamerule doFireTick true
|
gamerule doFireTick true
|
||||||
```
|
```
|
||||||
|
|
||||||
**On First Client Connect**
|
**On First Client Connect**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
RCON_CMDS_FIRST_CONNECT: |-
|
RCON_CMDS_FIRST_CONNECT: |-
|
||||||
/pregen stop
|
pregen stop
|
||||||
```
|
```
|
||||||
|
|
||||||
**On Last Client Disconnect**
|
**On Last Client Disconnect**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
RCON_CMDS_LAST_DISCONNECT: |-
|
RCON_CMDS_LAST_DISCONNECT: |-
|
||||||
/kill @e[type=minecraft:boat]
|
kill @e[type=minecraft:boat]
|
||||||
/pregen start 200
|
pregen start 200
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user