Persistent Spawner Reset
Persistent Spawner Reset is a KubeJS server script for Minecraft 1.20.1 that automatically restores broken mob spawners after a configurable delay.
The script preserves the original spawner data, temporarily keeps the required chunk loaded, and persists pending restorations across server restarts and world reloads.
Features
- Automatic Spawner Restoration — Broken mob spawners automatically return after a configurable amount of time.
- Original Spawner Data Preservation — The original spawner NBT is preserved, including the entity assigned to the spawner and its configuration.
- Persistent Restorations — Pending spawners are saved and recovered after server restarts or world reloads.
- Remaining Time Preservation — The restoration countdown continues from the remaining time after the server or world is loaded again.
- Automatic Chunk Loading — The affected chunk is temporarily kept loaded while a spawner is waiting to be restored.
- Automatic Chunk Cleanup — The forced chunk is released when all pending spawners inside it have been restored.
- Multiple Spawner Support — Multiple broken spawners can be tracked simultaneously, including multiple spawners inside the same chunk.
- Forced Restoration — When the timer expires, the original spawner is restored even if another block has been placed in its original position.
- Dimension Support — Spawners are tracked together with their dimension and coordinates.
Configuration
The restoration delay can be changed directly at the beginning of the script.
By default:
3 minutes = 3600 ticks
Minecraft runs at 20 ticks per second, so the value can easily be adjusted to use a different restoration time.
Installation
- Install KubeJS for Minecraft.
- Download the Persistent Spawner Reset ZIP file.
- Extract the downloaded ZIP file.
- Move
spawner-reset.jsto:
kubejs/server_scripts/
- Restart the server or world.
The script is intended to run on the server side.
Updating
When updating to a newer version, replace the existing spawner-reset.js file inside kubejs/server_scripts/ with the new version and restart the server.
Requirements
- Minecraft: 1.20.1
- Mod Loader: Fabric
- Java: 17
- KubeJS — Required
Notes
This script is designed for worlds and servers where mob spawners should act as renewable structures instead of being permanently destroyed.
Pending restorations are stored persistently, preventing a server restart or world reload from permanently removing a spawner that was already scheduled to return.
Credits
Created by zclashtm.