promotional bannermobile promotional banner

Villages&Pillages Hang Fix

Stop shutdown hangs with Villages&Pillages by having its tree check read structures from the generating chunk instead of the server thread.

Stop a server with Villages&Pillages 2.0.0 from hanging on shutdown, by having its tree check read structures from the generating chunk instead of waiting on the server thread.

Villages&Pillages keeps trees from growing inside witch villages. In 2.0.0 for NeoForge 1.21.1, that check asks the server level for structure data from a world-generation worker thread. The worker waits for the server thread and keeps nearby chunks loaded. If the server stops during that wait, it can keep unloading chunks and never finish saving, so the server has to be killed. This happens on dedicated servers and in singleplayer worlds.

After Villages&Pillages' code has been applied, this mod rewrites that one lookup to read the structure data the generating chunk already holds, the way Villages&Pillages 1.0.x did through YUNG's API. Witch villages get the same trees as before. Positions outside the generating region are treated as having no structure, and other levels, such as a sapling growing on the server thread, keep the original lookup.

  • One call, nothing added: no blocks, items, recipes, commands or options, no extra libraries, and none of Villages&Pillages' code bundled or copied.
  • Server side: players joining a server do not need the mod on the client.
  • If the check changes: on a later Villages&Pillages version without that call, the mod leaves the game as it is and writes one line to the log.

On a development server, 2,482 rewritten lookups were checked against the original call and none disagreed; witch-village structures were found in 15 of them. On a 490-mod All the Mods 10 server, all 20 shutdowns with the fix finished saving, while 3 of 13 earlier runs without it did not.

Villages&Pillages is required; there is nothing to configure.

Support my mods on Patreon Follow @kuronami333 on X Watch KURONAMI on YouTube

Need a custom mod?

Paid commissions for videos, streams and servers. Send me your idea: kuronami.mods@gmail.com

All Rights Reserved. Free to put in any modpack, on any platform, monetised or not - no permission needed, no credit required. Source is published so you can read exactly what it does. Source code: https://github.com/KURONAMI333/villages-and-pillages-hang-fix Bugs and questions: comment on the CurseForge page, or DM @kuronami333 on X.

Villages&Pillages Hang Fix Team

profile avatar
  • 16
    Followers
  • 85
    Projects
  • 1.0M
    Downloads

More from KURONAMlView all

  • Xaero's Map: 3D (Diorama) project image

    Xaero's Map: 3D (Diorama)

    Use Diorama to draw Xaero's World Map as an angled 3D terrain you can still drag and zoom, with your waypoints on the ground they mark.

    • 3.4K
    • November 30, 2026
  • JEI Quick Join project image

    JEI Quick Join

    Stops JEI from preparing tooltip search at world join, so its loading work ends sooner and you join faster.

    • 46
    • November 29, 2026
  • JourneyMap: 3D (Diorama) project image

    JourneyMap: 3D (Diorama)

    Use Diorama to draw JourneyMap's fullscreen map as an angled 3D terrain you can still drag and zoom, with its waypoints on the ground they mark.

    • 1.5K
    • November 29, 2026
  • Diorama Extras project image

    Diorama Extras

    Deepen Diorama's map zoom outside the overview layer and add filters, waypoint export and a searchable settings screen.

    • 459
    • November 29, 2026
  • Xaero's Map: 3D (Diorama) project image

    Xaero's Map: 3D (Diorama)

    Use Diorama to draw Xaero's World Map as an angled 3D terrain you can still drag and zoom, with your waypoints on the ground they mark.

    • 3.4K
    • November 30, 2026
  • JEI Quick Join project image

    JEI Quick Join

    Stops JEI from preparing tooltip search at world join, so its loading work ends sooner and you join faster.

    • 46
    • November 29, 2026
  • JourneyMap: 3D (Diorama) project image

    JourneyMap: 3D (Diorama)

    Use Diorama to draw JourneyMap's fullscreen map as an angled 3D terrain you can still drag and zoom, with its waypoints on the ground they mark.

    • 1.5K
    • November 29, 2026
  • Diorama Extras project image

    Diorama Extras

    Deepen Diorama's map zoom outside the overview layer and add filters, waypoint export and a searchable settings screen.

    • 459
    • November 29, 2026