Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I am searching for a Linux commandline tool to use the rcon to send Command to the minecraft server.

While I found one in the Minecraft Forum it does not work as expected, most time the Auth Succeeds but the Command does not get executed and the programm quit in reading the results from the Server

Any hints for a working program, or how to fix the mentioned one?

share|improve this question
    
You want to send commands from the same machine, or a different one? –  Maerlyn Jan 22 '12 at 16:59
    
The same one, I have already used HTTPConsole, but since RCon is build in now, would like to use rcon. –  Lairsdragon Jan 22 '12 at 19:14
add comment

2 Answers

I'm assuming you're running minecraft in a screen session, since it's the most convenient way to not force you to keep an ssh connection always open.

You can send a command to screen that it forwards to the application running inside it. For example, I am running it in a screen session called minecraft, and every few hours a script runs, forces a save, toggles autosave off, does a backup of my worlds files, then turns autosave back on.

This is how you start a new screen session called minecraft:

screen -S minecraft

then you get a shell, you may also pass the command you want to run automatically instead of getting a shell.

Then you can send commands to that session:

screen -p 0 -S minecraft -X eval "stuff save-all\015"
  • -p 0 sends the message to window 0 in the session
  • -S minecraft is the session name
  • the rest tells to print "save-all" and a newline to the application's stdin
share|improve this answer
    
Thanks for this suggestion. While this works most of the time, I had problems with this way especially if I am already connected to the screen session. Therefore I would prefer a solution for rcon since there is a second commandchannel which does not rely or interfere with the STDIN.. –  Lairsdragon Jan 22 '12 at 20:41
add comment

Try mcrcon.

Description from the website:

Description

Mcrcon is powerful minecraft rcon client / terminal with bukkit coloring support. It is well suited for remote administration and to be used as part of automated server maintenance scripts. Does not trigger "IO: Broken pipe" or "IO: Connection reset" spam bug on server side.

Precompiled binaries available for Windows (x86), Linux (x86) and Mac OS X (x86 / x86-64).

Features

  • Interactive terminal mode. Support for Bukkit coloring on Windows and sh compatible shells.
  • Send multiple commands in one command line.
  • Silent mode. Does not print rcon output.
  • Does not cause "IO: Connection reset" spam on server side.
  • Designed to be used as part of the toolchain in server maintenance scipts.
share|improve this answer
    
Welcome to Gaming. While this program may answer the question, you should explain why you think this program is the one the asker needs, and maybe give a little guide on using it. –  Jupotter May 4 '12 at 7:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.