Skip to content

Commit f67d394

Browse files
authored
docs: Cleanup RCON_CMDS examples (#1526)
1 parent bc3c3db commit f67d394

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,48 +1562,50 @@ To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The
15621562
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
15631563
```
15641564
1565-
### Use RCON commands
1565+
### Auto-execute RCON commands
15661566
1567-
Feature is used run commands when the server starts, client connects, or client disconnects.
1568-
**Notes:**
1569-
* On client connect we only know there was a connection, and not who connected. RCON commands will need to be used for that.
1570-
* Using '|-' is preferred for yaml, this make sure only the correct new lines are in place for the commands.
1567+
RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects.
1568+
1569+
> When declaring several commands within a compose file environment variable, it's easiest to use YAML's `|-` [block style indicator](https://yaml-multiline.info/).
15711570
15721571
**On Server Start:**
15731572
15741573
```yaml
15751574
RCON_CMDS_STARTUP: |-
1576-
/gamerule doFireTick false
1577-
/pregen start 200
1575+
gamerule doFireTick false
1576+
pregen start 200
15781577
```
15791578

15801579
**On Client Connection:**
15811580

15821581
```yaml
15831582
RCON_CMDS_ON_CONNECT: |-
1584-
/team join New @a[team=]
1583+
team join New @a[team=]
15851584
```
15861585
1586+
**Note:**
1587+
* On client connect we only know there was a connection, and not who connected. RCON commands will need to be used for that.
1588+
15871589
**On Client Disconnect:**
15881590
15891591
```yaml
15901592
RCON_CMDS_ON_DISCONNECT: |-
1591-
/gamerule doFireTick true
1593+
gamerule doFireTick true
15921594
```
15931595
15941596
**On First Client Connect**
15951597
15961598
```yaml
15971599
RCON_CMDS_FIRST_CONNECT: |-
1598-
/pregen stop
1600+
pregen stop
15991601
```
16001602
16011603
**On Last Client Disconnect**
16021604
16031605
```yaml
16041606
RCON_CMDS_LAST_DISCONNECT: |-
1605-
/kill @e[type=minecraft:boat]
1606-
/pregen start 200
1607+
kill @e[type=minecraft:boat]
1608+
pregen start 200
16071609
16081610
```
16091611

0 commit comments

Comments
 (0)