RegenZones logoRegenZones

Regeneration Engine

What happens between a block breaking and it coming back.

This page covers what RegenZones actually does to a block from the moment it breaks to the moment it returns, and the settings that shape that process.

The lifecycle

The regeneration lifecycle of a handled block. Break and capture its full block data, swap in the temporary block, store a pending entry in the database, wait out the regen time, then restore the original block data in a batch. The pending entry survives a restart because it lives in storage, not memory.
  1. Capture. The block's full data is captured, not just its material. Crop growth stage, log axis, slab half, ore variant, whatever state that block type has, comes back exactly as it was.
  2. Drops and experience. The rule's drops and experience settings decide whether the break gives its normal items and orbs.
  3. Swap. The rule's replace-with block is placed immediately, bedrock by default. With several growth stages, the first is placed and the rest follow in turn across the regen time.
  4. Store. A pending entry (world, coordinates, the original block data, the temporary stages, the swap time and the restore timestamp) is written to storage.
  5. Restore. Once the regen time is up, the original block data is placed back and the pending entry is deleted.

Batched restores

A large region finishing its timer all at once would restore hundreds of blocks in a single tick and stall the server. regeneration.blocks-per-tick in config.yml caps how many blocks come back per tick, spreading a big restore out smoothly instead.

Restart safety

Pending entries live in the database (see Storage), not in memory, so a crash or a restart never leaves a temporary block sitting there forever.

On startup, RegenZones checks every pending entry. Anything whose timer already ran out while the server was down is restored straight away, in the same batches as normal. Everything else keeps counting down from where it left off, and a block with growth stages is moved to whichever stage is due by now.

regeneration.regen-all-on-shutdown flips this around: when true, every pending block is restored the moment the server stops, instead of waiting for the next start. It is false by default.

Unloaded chunks

By default, regeneration.regen-in-unloaded-chunks is true, so a block restores on schedule even if nobody is anywhere near it. Set it to false to hold a restore until its chunk is loaded again instead.

Restore effects

regeneration.effects plays a sound and a particle when a block comes back, both switchable with enabled, and both configurable by name (sound, particle).

Manual restores

/rz regen <name> restores every pending block in a region immediately, without waiting out the timers. Deleting a region with /rz delete <name> does the same thing first, then removes the region.

Drops straight to the inventory

/rz collect <name> [on/off] sends a handled block's drops straight to the breaking player's inventory instead of dropping them on the ground, when drops is on for that rule. Overflow, once the inventory is full, still drops on the ground normally rather than being lost. defaults.collect-to-inventory in config.yml sets what a region does when it has not set this itself, off by default.

An ItemsAdder custom block's loot is spawned by ItemsAdder itself, from its own loot table, so RegenZones cannot compute it the way it does vanilla drops. For those blocks the spot is watched for a few ticks after the break and whatever ItemsAdder drops there is moved into the player's inventory instead. A rule with drops: false removes that loot the same way.

Placed blocks become delay blocks

/rz placed <name> [on/off] makes a handled block a player places inside the region go straight into its delay state, as if it had just been broken: the rule's replace-with block appears on the spot and the real block arrives once the regen time is up. The case that asked for it is a farm zone with a CARROTS rule replacing with CARROTS[age=0]: plant a carrot and it sits there, locked, as a fresh crop, then comes back fully grown. It applies to any handled key though. Place an ore in a mine zone with the flag on and it turns into the placeholder, then into the ore after the timer.

  • The placed block has no earlier state to restore to, so it comes back exactly as placed, with one exception: anything with a growth age comes back at its final stage, otherwise a planted crop would return as a planted crop.
  • Only keys the region handles are affected. A block with no rule stays as placed.
  • Nobody is exempt, staff included, same as the strict lock. Disable the region with /rz toggle <name> off to build inside it, then enable it again.
  • Placing on a spot that is already pending is still denied by the place protection.

defaults.delay-placed in config.yml sets what a region does when it has not set this itself, off by default.

Right-click harvest

A rule with harvest: true starts the same cycle from a right click instead of a break: drops are handed out, the first replace-with stage goes in on the spot and the block regenerates on its timer. No break event is involved, so it behaves the same in Adventure mode and ItemsAdder does not drop a second set of loot. See Block Rules.

Things it does not do

  • A block that breaks because its support was removed (sugar cane losing its water, torches, crops on a broken farmland block) does not fire a break event on plain Spigot, so RegenZones only tracks the block that was actually acted on, not indirect breaks caused by it.
  • Two-block-tall plants and doors are captured and restored by the half that was actually broken, nothing more.

On this page