RegenZones logoRegenZones

Block Rules

Deciding which blocks a region handles and how conflicts resolve.

A block rule tells a region what to do with one material or one group of materials. This page covers writing rules and how RegenZones picks a rule when more than one could apply.

Materials and groups

A rule is keyed by either:

  • an exact material name, for example GOLD_ORE
  • a group, written as group:<name>, for example group:ores

Groups are defined in blocks.yml. RegenZones ships four by default:

GroupCovers
group:oresEvery ore, including deepslate and nether variants
group:logsEvery log and stripped log
group:cropsEvery crop, wheat through the newer pitcher and torchflower crops
group:stone_typesNatural stone family blocks, including the 26.x sulfur cave blocks

Materials that do not exist on the server's running version are skipped quietly when blocks.yml loads, with one summary line in the console rather than a warning per block.

Handling everything with a wildcard

A region can use * instead of listing materials, which hands it every block except whatever is in that region's excluded list. Add to that list with /rz exclude <name> <material>.

blocks:
  "*": {}
excluded:
  - CHEST

Containers are never handled unless you list them explicitly. Restoring a chest would give back an empty chest, since only the block data is captured, not what is inside it. That is why chests are not in any shipped group and are a sensible thing to keep in excluded if you use a wildcard.

What a rule sets

Each rule can set:

FieldWhat it controls
regen-timeHow long before the block comes back. Accepts 30s, 5m, 1h30m style values, or a plain number of seconds
replace-withThe block shown while the original is away, any material or full BlockData string, AIR for an empty space, or an installed ItemsAdder block. A list shows several in turn, see Growth stages
dropsWhether breaking it gives the normal drops
experienceWhether breaking it gives the normal experience
harvestWhether right-clicking it takes it the way breaking it would, see Right-click harvest
harvest-dropsWhat a right-click harvest gives instead of the block's own drops, see Harvest drops
harvest-onlyBreaking the block does nothing, a right-click harvest is the only way to take it, see Harvest only
required-toolThe least tool that takes the block, see Required tool

replace-with is validated as a real BlockData string, not just a bare material. A plain name like BEDROCK works exactly as it always has, but so does a state-bearing string like CARROTS[age=0], useful as a regen-delay placeholder that shows a freshly planted crop instead of a full grown one. Casing does not matter. A value set through a command or the menu is written to regions.yml as minecraft:carrots[age=0], the canonical form, while config.yml and blocks.yml can keep the plain BEDROCK style.

A rule does not have to set every field. Anything left out is filled in from further down the resolution order below, so a rule that only changes the regen time still inherits its replace block, drops and experience setting from wherever they are next defined.

Growth stages

replace-with can be a list instead of one block. Each entry is shown in turn, each for an equal share of the regen time, and the original block comes back at the end. A crop can visibly grow back instead of jumping from seedling to ripe:

blocks:
  WHEAT:
    regen-time: 2m
    replace-with:
      - "minecraft:wheat[age=0]"
      - "minecraft:wheat[age=3]"
      - "minecraft:wheat[age=5]"

With 2m and three stages, each stage shows for 40 seconds, then the ripe wheat returns. Entries can mix vanilla blocks and ItemsAdder ids. The stage due is worked out from when the block was swapped, so a restart resumes at the right stage.

From a command, every value after the first is a further stage:

/rz setreplace farm yourpack:pineapple_stage_4 yourpack:pineapple_stage_1 yourpack:pineapple_stage_2 yourpack:pineapple_stage_3

In the config GUI, type the stages on one line separated by spaces.

Right-click harvest

A rule with harvest: true lets a player right-click the block instead of breaking it. It is taken with its normal drops (into the inventory if the region has /rz collect on), the first replace-with stage goes in straight away, and the block regenerates as usual. Combined with growth stages this is a replantless crop: right-click the ripe crop, it goes back to its first stage, grows through the rest, and is ripe again at the end.

/rz setharvest <name> <material/group> <on/off>
/rz setharvest <name> all <on/off>

all sets it on every rule the region has at once, for a zone that is nothing but crops.

  • A vanilla crop is only harvested at its final age. Right-clicking an unripe one does whatever it normally would.
  • An ItemsAdder block in Survival is broken for real by the right click, so it drops exactly what breaking it by hand drops, whether that comes from a loot table or a break action in the pack. In Adventure or Creative it falls back to the pack's loot tables, never the block's own item.
  • Harvesting a vanilla block gives no experience.
  • Sneaking with an item in hand skips the harvest, the same as sneaking skips using a block in vanilla, so blocks can still be placed against a harvestable one.
  • Breaking the block still works too, through the normal break path.

defaults.harvest in config.yml sets the value for a rule that does not set its own, false by default.

Harvest drops

harvest-drops lists exactly what a right-click harvest gives, in place of the block's own drops. Each entry is a vanilla item or an ItemsAdder item id, optionally followed by an amount or a min-max range, rolled fresh on every harvest:

blocks:
  yourpack:pineapple_stage_4:
    harvest: true
    harvest-drops:
      - "yourpack:pineapple 1-2"
      - "WHEAT_SEEDS"
/rz setharvestdrops <name> <material/group> <item> [amount] [item [amount]...]
/rz setharvestdrops <name> <material/group> clear

Use it when right-clicking an ItemsAdder crop gives nothing while breaking it does. Some packs drop a crop's item from an action ItemsAdder only runs when the block is mined by hand. With harvest-drops set, nothing depends on that: the listed items are given and the block goes to its first stage the same way a vanilla crop does.

  • The listed items are given even when the rule has drops: false, since they are set for the harvest on purpose. Breaking the block is not affected at all.
  • /rz collect decides inventory or ground, the same as for any other drop.
  • Amounts go from 1 to 64. A listed item that no longer exists is skipped with a console warning.
  • clear unsets it, and the harvest goes back to the block's own drops.

Harvest only

harvest-only: true makes a normal break on a harvestable block do nothing: the block stays exactly as it is and the player is told to right-click it instead. Use it for a crop that should only ever be harvested, or a log that should only be taken with a right click. Leave it off for a block that can be harvested or broken, either way.

blocks:
  yourpack:pineapple_stage_4:
    harvest: true
    harvest-only: true
/rz setharvestonly <name> <material/group/all> <on/off>
  • It only does anything while harvest is on for the block too, otherwise nothing could take it at all. Setting it with harvest off says so.
  • It holds for ops and bypass holders in Survival. Creative still breaks the block, so staff can rework a zone.
  • A vanilla crop with harvest-only cannot be broken while unripe either, it waits until it is ripe and gets harvested.

Required tool

required-tool is the least tool that may take the block. A vanilla tool with a tier is a minimum: IRON_PICKAXE accepts an iron, diamond or netherite pickaxe and refuses a wooden, golden, stone or copper one. Any other item, SHEARS say, or an ItemsAdder item id, has to be that exact item.

blocks:
  DIAMOND_ORE:
    required-tool: IRON_PICKAXE
/rz settool <name> <material/group/all> <tool>
/rz settool <name> <material/group/all> none
  • Tiers go wooden and golden, then stone and copper, then iron, diamond, netherite, the same order vanilla mining uses. A custom tool built on a vanilla one counts as that vanilla tool.
  • A refused break does nothing and the player is told which tool they need. A right-click harvest needs the same tool.
  • It holds for ops and bypass holders in Survival, not in Creative.
  • none clears it, the block then goes by blocks.yml again, or needs no tool.

Resolution order

When a block is broken, RegenZones works out which rule applies by checking, in order, the region's own rules, then the shipped blocks.yml rules, then the config defaults. The first place a field is set wins, checked separately for each field.

How a block's rule is worked out. First the region's own rule for the exact material, then the region's rule for a group containing it, then the region's wildcard rule, then the matching rule in blocks.yml, then the defaults in config.yml. The first step found wins and the rest are skipped.
  1. The region's own rule for the exact material.
  2. The region's own rule for a group containing that material.
  3. The region's own * wildcard rule.
  4. The matching rule in blocks.yml (exact material, then its group).
  5. The defaults under defaults in config.yml.

Custom blocks (ItemsAdder)

If ItemsAdder is installed, a rule can be keyed by one of its custom blocks directly, using its namespace:id in place of a material name:

/rz addblock <name> yourpack:your_ore 10s BEDROCK
/rz setreplace <name> yourpack:your_ore yourpack:cracked_your_ore

Breaking a handled custom block captures its real identity, not the vanilla block it is skinned on top of, and restores the same custom block when its timer runs out. A blocks.yml group can mix material names and ItemsAdder ids in the same list:

groups:
  ores:
    - GOLD_ORE
    - yourpack:blue_ore

ItemsAdder is an optional soft dependency, not required. Custom block support only activates when ItemsAdder is installed and detected, and can be switched off entirely with itemsadder.enabled: false in config.yml even while it is installed. See Configuration.

Setting rules with commands

/rz addblock <name> <material/group> [time] [replace] [next stage...]
/rz removeblock <name> <material/group>
/rz settime <name> <material/group> <time>
/rz setreplace <name> <material/group> <replace> [next stage...]
/rz setharvest <name> <material/group/all> <on/off>
/rz setharvestdrops <name> <material/group> <item> [amount] [item [amount]...] | clear
/rz setharvestonly <name> <material/group/all> <on/off>
/rz settool <name> <material/group/all> <tool/none>
/rz exclude <name> <material>

/rz addblock fills in anything you do not pass from the resolution order above. Every argument tab completes, including material names, group names and existing region names. See Commands for the full table.

On this page