As we all know , a Minecraft Server keeps the spawn chunks loaded all the time (if you don't know, read these questions: one two). So ticks keep passing by. I'm keen of the fact that in these ticks not everything is processed like there is a player nearby that is responsible for the loaded chunks.

Normally these questions go in the direction "I want something loaded and processed" but I'm looking for the opposite. In normal vanilla Minecraft there is no calendar, there is only day and night. Because of this the impact of ticking is not quite as relevant. But for mods like TerraFirmaCraft with calendar and stuff, this is a bit of a problem because you will starve while you're, for example, at work.

I found some scripts in python that act like some kind of proxy. Listening to the default Minecraft port 25565 and if they get any connection starting up a real server in the background passing the traffic over. If all players disconnect, after some time, the server gets shut down and the whole process starts over again.

As I'm using a hosted solution I can only run *.jars, so python and shell scripts are out for this. Is there any solution using Forge or a Java Wrapper to accomplish this type of behavior?

Manually starting and stopping the server all the time is no solution in this case.

  • set spawn load area to 0 (in the vanilla config) – ratchet freak May 26 '14 at 8:40
  • 2
    what is spawn load config? Only thing I know is spawn protection area that can be set. Could you provide more information? – Mose May 26 '14 at 10:23

In the spawn chunks, use a command block with the command:

/testfor @a

With a comparator coming out of it connected to a block, place redstone dust on top of the block leading to a command block with the command:

/gamerule randomTickSpeed (speed, default is 3)

and a torch going out of the block with redstone dust connecting it to a command block with the command:

/gamerule randomTickSpeed 0

| improve this answer | |
  • 4
    Very good find, but I doubt it will help OP's specific problem. Nor does it precisely do what OP was asking for. randomTickSpeed is new in 1.8 and modpacks like TerraFirmaCraft don't run on 1.8 yet. Furthermore, this gamerule only affects the random ticks, which control plant growth etc., not the time of ticks per se. TFC probably does not use random ticks for the problems that OP wishes to address. – MrLemon Jan 5 '15 at 9:56
  • As MrLemon stated. But still a good answer to another question ;-) – Mose Feb 2 '15 at 15:47

Spawn chunks, as far as I know, do not stay active as long as no players are currently in that dimension. If all players are in the Nether or End, the overworld spawn chunks cease to tick. If no players are online, it's the same result. The day cycle continues as normal, as does anything else that doesn't have to do with physical chunks. While I don't know about Forge (I use command blocks for everything), all chunks should stop ticking when nobody is online. I do have one solution to try, though. If the modification you're using uses the day cycle to run it's calender, you can stop the day cycle with ' /gamerule doDaylightCycle false ', or use some kind of plugin to do that for you. I hope that I helped in some way. Have good luck.

| improve this answer | |

Ifound this thing for you. Maybe you can do something with it, perhaps you will need some script or so, but that is up to you. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2421222-tickratechanger-change-the-speed-that-your-game

| improve this answer | |

I would suggest you would switch to Bukkit or a fork (Spigot) as they allow the opportunity to shut down the server at regular intervals if no players are online or could possibly unload any chunks at an interval where players are not nearby.

You can also combine this with Remote Toolkit so you can easily allow an automatic restart when the server is stopped.

| improve this answer | |
  • Are you absolutely sure that you can use Forge with Bukkit? Seems strange to me... – Mose May 29 '14 at 1:41
  • 1
    @Mose No, you can't. Bukkit and Forge are two separate frameworks and they don't play nice with each other. – Nathan C May 30 '14 at 13:45
  • 1
    There are Forge ports that work with Bukkit, have a look. – Hexcept May 30 '14 at 14:15

The system you are requesting is based on Heartbeat activation.

Sadly as far as I know port listening and handling will need to be handled outside of the normal jars that run the game.

Essentially you would need to have a trigger detecting port activity that switches everything on and off but as you have no access to python or other scripts outside of Minecraft this would need a custom Minecraft server jar to handle the port listening.

I would suggest migrating your server to a system with higher levels of control.

| improve this answer | |

Check out this link on Github. It's a python script that listen for connections and when a player connects it launches the Minecraft server. If there are no players it just stops the Minecraft server.

(It's made for Minecraft vanilla but it's so easy to configure also for other types of Minecraft servers (just follow the guide))

And it's updated to 2019 if someone needs it!

i created this myself and would be happy if you used this!

| improve this answer | |
  • 1
    As I said on another answer of yours, as you appear to be affiliated with the link you should edit this post to disclose affiliation else this is liable for deletion for being spam. – TheLethalCarrot Sep 11 '19 at 12:39
  • This solution is already explicitly addressed in the question as one that does not work in the hosting environment being used. – SevenSidedDie Sep 12 '19 at 7:10
  • @TheLethalCarrot i'm sorry i didn't mean to do any harm to anyone. (i'm new to this world of Q/A) and i just wanted to say to people that i worked like a dog to find a solution and i would just be proud if people used my code (which is completely free and i don't earn anything but happiness) – gekigek99 Oct 13 '19 at 10:53

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.