docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Run RCON commands on player death.

Open holy-elbow opened this issue 1 year ago • 1 comments

Enhancement Type

A completely new feature

Describe the enhancement

add a variable to run rcon commands on player death: been trying to get a bash script to work, but struggling with a lack of familiarity with rcon and detecting minecraft events.

should add I have tried both using tail -f for latest.log to search for player death but the variation in death messages makes this unreliable. I had more success with a scoreboard object that tracks deathCount, running commands and then resetting the scoreboard back to 0. My problem is I cannot figure out how to get this to work with a persistent rcon connection, or by checking the scoreboard without an rcon call. This results in spamming the logs with constant rcon messages. Any help would be appreciated!

holy-elbow avatar Nov 26 '24 22:11 holy-elbow

I don't think that capability should be implemented as part of the image. As you pointed out, Minecraft doesn't have a way to hook into arbitrary events externally. This image basically preps the data directory and then kicks off the Minecraft server process. In case you're wondering, the player connected/disconnected handling is basically faked by having a loop query the status endpoint for player counts.

Implementing as a plugin would be much better IMHO. Or if you don't want to develop that, then something that reads the container logs via docker API would be next best.

itzg avatar Nov 27 '24 03:11 itzg

This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.

github-actions[bot] avatar Dec 28 '24 02:12 github-actions[bot]