Skip to content

ZenRebuildableWells

Zenarchist edited this page Jun 9, 2026 · 5 revisions

Source: https://github.com/ZenarchistCode/ZenRebuildableWells

NOTE: This mod is included in my modpack and can be enabled/disabled via ZenRebuildableWells in ZenModPackConfig.json

Before & After:

wells

What Is This?

This mod adds the ability to rebuild defunct wells. It requires all the attached materials + a sledgehammer or pickaxe to build, and is persistent.

The wells are the ones screenshotted above, usually found in remote areas, great for building an off-grid home!

The server config allows admins to specify how long the wells last for once rebuilt.

Make sure to add the types.xml entries included in the mod folder to prevent the wells despawning on restarts.

This mod uses the same method as my firewood piles + chicken coops mods - when the server starts up for the first time after installation, it may lag for a couple of minutes as it scans the entire map for the target static well object locations (misc_well.p3d) - it then spawns an invisible proxy object over the well with the required material attachments for building. This process only happens once (unless forced by JSON config).

There are 3 steps to the mod's functionality, it's complicated to explain in plain English but it's not really that complex:

  1. The mod scans the map for the broken static well objects and spawns a persistent invisible proxy on them (Zen_RebuildableWell) with a default lifetime of 999999 unless a types.xml entry is specified to override its lifetime. Usually you'd want this "rebuildable" invisible proxy to stay for an entire server wipe cycle, so 999999 is fine and you do not need to do anything if you're happy with this setup.

  2. Once the player "builds" the well by attaching all the required materials + using a sledgehammer/pickaxe on Zen_RebuildableWell, that invisible object is deleted and replaced with a different invisible object which will spawn a regular vanilla well on top of it inside of the static well object on every server startup. This new invisible proxy object is called Zen_RebuiltWell_Spawn and is persistent. So, to set how long a rebuilt well lasts for, you can add a types.xml entry. By default the Zen_RebuiltWell_Spawn entity's lifetime is also forced to 999999 within the mod's code unless it's specified in your types.xml, which means with the default setup and not touching anything in your server config, a rebuilt well lasts forever until the server is wiped or an admin deletes it.

  3. If the well despawns for any reason, the Zen_RebuildableWell invisible buildable proxy respawns back on the well and players will need to rebuild it to use it again. So if you want wells to "break" after a certain period of time, add a types.xml entry for Zen_RebuiltWell_Spawn and specify how long the well should last before requiring rebuilding.

Here's an example using the lifetime config of a vanilla Fence (which means a nearby territory flag WILL keep it alive):

    <type name="Zen_RebuildableWell">
        <nominal>0</nominal>
        <lifetime>3888000</lifetime>
        <restock>0</restock>
        <min>0</min>
        <quantmin>-1</quantmin>
        <quantmax>-1</quantmax>
        <cost>100</cost>
        <flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="1" deloot="0"/>
        <category name="tools"/>
    </type>

JSON Config

Config file: profiles/Zenarchist/ZenRebuildableWellsConfig.json

{
    "ConfigVersion": "1.29.1", // Don't touch
    "DumpAllObjects": 0, // Force a re-dump of all well locations on map
    "SpawnMapGroupPosXML": 0, // Prints mapgrouppos.xml locations to profiles root folder
    "SpawnObjects": 0, // Turn on/off spawning the wells (do not touch - this is handled automatically)
    "SpawnHooks": [ // List of objects to "hook" onto to spawn these rebuildable well objects
        {
            "TargetObjectType": "misc_well.p3d",
            "SpawnObjectType": "Zen_RebuildableWell",
            "SpawnObjectScale": 1.0,
            "OffsetPosition": [
                0.0,
                0.0,
                0.0
            ],
            "OffsetOrientation": [
                0.0,
                0.0,
                0.0
            ],
            "ChanceOfSpawn": 1.0
        }
    ],
    "DamageTool": 100, // How much to damage the build tool (sledgehammer)
    "RespawnRebuildableWells": 1, // If true, then when a rebuilt well despawns, players can re-build it
    "DeleteRebuildableWells": 0, // This will delete all rebuildable wells off the map
    "AllowDismantleWell": 1 // Enable/disable destroying a rebuilt well with a sledgehammer
}

ZEN'S MOD WIKI

Setup Guide

General Information


Utilities

My utility style mods for debugging etc.

Game Mechanics

Mods which affect game mechanics:

Gear / Objects

Mods which add gear to the game:

Server-Side Mods

Mods which run purely server-side:

Mods Not In Modpack

My standalone mods

Clone this wiki locally