2

Running server 1.8.4 GUI with command line on it on a win7. I want to send list of commands to that command line but I don't really understand how the things works. The point is to build huge things with thousands of commands so I wrote few php scripts that generates lists of commands I need to build those but I don't know how to execute them 1 by 1.

My first guess is to send a command to a server process from command line. Is it possible? If it is, is it also possible to save a command list to a batch file and somehow execute them one by one?

2

Well, if your script is capable to send commands to the server (via RCON or similar), then you just need to send them all one by one.

However that could be really slow and not quite good. Because your script cannot have "back checks", the server will just make the command (or won't) and script won't have any info how (and when) it finished. So you will need to call the next command when you will be sure the previous one is completed. That can be really painful to construct (and if server lags, you need to probably manually check where it finished or start over again).

There is also another possible solution, but it needs some changes to your server. If you know anything about Bukkit/spigot servers capable running server-only plugins, then it will be easy for you, otherwise you should study something about it. The thing is that there are already well-developed tools for mass changes in worlds, but you need Spigot server to run them.

That tool is WorldEdit, which is kind of superior in large scale building and changing of blocks. However it is not comfortable with commands from console, it is mainly built as ingame (player position dependant) tool.

BUT it can run SCRIPTS , you also are able to write your own scripts, so then you just need to call them and automatic creations are no problem. All you nee to know for writing those scripts is JavaScript.

This plugin is well updated and have quite good documentation, you can try it. It will be definetly better than sending thousands of commands to your server directly.

  • Definitely. About "back checks" I have few more questions. When you execute some command, server gives you an answer, something like: "N blocks changed", - for example, so there might be a way to save the answer to some text file and then check it if ok, go on or try again. Is this what you call painful? I mean for me if it's possible it might be easier to learn batch script and try this way first instead of learn plugins and script language that useful for minecraft only. Thats why I still asking if you could give me example of how to send a single command from batch file to minecraft server. – Al Po Oct 6 '15 at 13:17
  • Well, JavaScript is usable for a lot of things nowadays, if you learn it, you for sure won't use it only in those scripts. Every web uses it and the tendency is to use it more and more. According to "read server response", everything is stored in logs (latest.log), however there is normally a lot of info you don't need but you will need to read and search in, you will need reopen the log after every command and search for expected line - not necessarily the last one, because log stores EVERYTHING from server run. I personally don't have experience with running commands from external source. – Antoine Hejlík Oct 6 '15 at 14:14
  • anyway thanks for your help, found it useful. I know JavaScript a little but for some reason I want a painful way with the batch right now :p so if anybody could help please read the post EDITED. – Al Po Oct 6 '15 at 14:19

Your Answer

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

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