0

I wish to fetch output from a screen running a Minecraft bedrock server, after executing list command to list online people on the server using

screen -X stuff 'list\n'

I wish to gain the output of this for use further in a python script as such, a file would be easy as then i can fetch everything after select few lines. I tried server logging but ended up with a bodge attempt of repeatedly attempting to remove log file, enable logging again and then executing the above command via

rm screenlog.0
screen -X log
screen -X stuff 'list\n'

What I was wondering was if there is a better way to do it. Tail isnt an option as multiple things can effect stdout in the screen.

  • I don't know Minecraft at all. In general a good server would open a port on localhost for telnet/nc communication, or it would provide a socket. You connect to it when the server runs, send a command, receive a response, disconnect. Proper protocol should return the response to the command only, not all real-time messages that are generated, unless you ask it to. Easy and straightforward. Is Minecraft server good enough to provide such interface? I found this but I don't know how it handles the "response only" rule. – Kamil Maciorowski Oct 12 at 21:39
  • @KamilMaciorowski thats a wonderful resource but is unfortunately for the java edition... – Blaine Oct 12 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.