Auto-execute RCON commands¶
RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects.
Note
When declaring several commands within a compose file environment variable, it's easiest to use YAML's |-
block style indicator.
On Server Start:
On Client Connection:
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 First Client Connect
On Last Client Disconnect
Example of rules for new players
Uses team NEW and team OLD to track players on the server. So move player with no team to NEW, run a command, move them to team OLD. Reference Article
RCON_CMDS_STARTUP: |-
/pregen start 200
/gamerule doFireTick false
/team add New
/team add Old
RCON_CMDS_ON_CONNECT: |-
/team join New @a[team=]
/give @a[team=New] birch_boat
/team join Old @a[team=New]
RCON_CMDS_FIRST_CONNECT: |-
/pregen stop
RCON_CMDS_LAST_DISCONNECT: |-
/kill @e[type=minecraft:boat]
/pregen start 200