pop4959 / Chunky

Pre-generates chunks, quickly, efficiently, and safely.
GNU General Public License v3.0
570 stars 64 forks source link

Add option to dynamically generate chunks #297

Closed StrongSand94191 closed 12 months ago

StrongSand94191 commented 12 months ago

Add an option to generate chunks while no players are online, and stop when a player joins.

pop4959 commented 12 months ago

This has been requested before, but the general consensus is that this kind of task is better suited for an add-on. There are plenty of plugins and mods that already exist that will handle this for you, or you can create your own.

Also keep in mind that generally this is not a useful thing to do, most servers keep up with world gen just fine even if players are online. Please see previously created issues for more information, as I do not want to repeat myself here, but I would recommend just trying it if you haven't already. If you are seeing significant problems while pre-generating please join the Discord server for help troubleshooting.

StrongSand94191 commented 12 months ago

That makes sense, I was able to do it myself

pop4959 commented 12 months ago

Glad to hear that it was easy! Don't forget to share the plugin if you think it might help other people with a similar need. Would also be nice to be able to point to one.

StrongSand94191 commented 12 months ago

I used a mod called Player Events with this config:

{
  "first_death": {
    "actions": [],
    "broadcast_to_everyone": true,
    "pick_message_randomly": false
  },
  "death": {
    "actions": [],
    "broadcast_to_everyone": true,
    "pick_message_randomly": false
  },
  "first_join": {
    "actions": [],
    "broadcast_to_everyone": true,
    "pick_message_randomly": false
  },
  "join": {
    "actions": [
        "/chunky pause"
        ],
    "broadcast_to_everyone": false,
    "pick_message_randomly": false
  },
  "kill_entity": {
    "actions": [],
    "broadcast_to_everyone": true,
    "pick_message_randomly": false
  },
  "kill_player": {
    "actions": [],
    "broadcast_to_everyone": true,
    "pick_message_randomly": false
  },
  "leave": {
    "actions": [
        "/scoreboard objectives add count dummy",
        "/execute store result score -.players count if entity @a[limit=2]",
        "/execute if score -.players count matches 1 run chunky continue"
        ],
    "broadcast_to_everyone": false,
    "pick_message_randomly": false
  },
  "custom_commands": []
}