BlockRegen
Ores and crops that come back after they are mined, with rewards, restore schedules, zones and profiles.
BlockRegen turns chosen blocks into nodes: when a player mines a node, it gives rewards, turns into a
placeholder block for a while, then comes back by itself. Use it for resource areas, dungeon ores or
farms that never run out. File: configs/extensions/BlockRegen.yml.
It works with two ideas:
| Idea | Says |
|---|---|
| Profile | What a node is: which blocks, how many hits, what it gives, how it comes back |
| Zone | Where profiles apply: worlds, WorldGuard regions or boxes of coordinates |
A block is a node only when it is inside a zone and its material belongs to a profile bound to that zone.
The default zone covers the whole world named dungeon and protects every block there that is not a
node: players cannot break anything else in that world. If you have a world with that name, change
the zone before starting the server with BlockRegen.
What happens when a node is mined
- The player breaks a node block. The block does not break the vanilla way.
- With
requiredBreaksabove 1, it takes that many breaks before anything else happens. - The player gets the profile's rewards and XP, and the block turns into its cooldown look.
- When its restore time comes, the block is put back as it was.
While a node is on cooldown, breaking it only shows a message. Crops with
requireFullyGrownAgeable: true count only when fully grown.
Nodes are saved to their own database, blockregen.db, so a restart does not lose them.
Profiles
profiles:
- id: diamond-1
enabled: true
displayName: "<aqua>Diamond Node"
priority: 100
materials:
- DIAMOND_ORE
- DEEPSLATE_DIAMOND_ORE
requiredPermission: ""
mining:
requiredBreaks: 1
requireFullyGrownAgeable: true
restore:
mode: INDIVIDUAL
cooldownSeconds: 300
cooldownVisual:
placeholderMode: CONFIGURED_MATERIAL
placeholderMaterial: BEDROCK
dropRules:
dropNaturalItems: false
dropNaturalExperience: false
extraExperience: 5
allowSilkTouchNaturalDrops: true
rewards:
rollsPerBreak: 1
rewardPool:
- "65 ; &aMoney! ; MONEY ; 500"
- "35 ; &eSupply crate! ; CONSOLE_COMMAND ; crate key give {player} dungeon 1"
chanceRewards:
- "0.05 ; &dRare relic! ; ITEM ; NETHER_STAR,1,true"
| Key | Default | Meaning |
|---|---|---|
id | The profile's id, used by zones and commands | |
enabled | true | Off, its blocks are not nodes |
displayName | Shown in menus and as {profile} in reward messages | |
priority | 100 | When two profiles claim the same material, the higher wins |
materials | The blocks that are nodes | |
requiredPermission | empty | A permission needed to mine these nodes. Empty for everyone |
noPermissionMessage | Sent to players without it | |
mining.requiredBreaks | 1 | Breaks needed before the node pays and goes on cooldown |
mining.requireFullyGrownAgeable | true | Crops count only when fully grown |
Coming back
restore.mode | The node comes back |
|---|---|
INDIVIDUAL | cooldownSeconds (300) after it was mined, each node on its own |
BATCH_WINDOW | At the next full step of batchWindowSeconds (300) on the clock. All nodes mined within one step come back together |
FIXED_INTERVAL | At the next full step of fixedIntervalSeconds (600) on the clock |
DAILY_TIMES | At the next time in dailyTimes, such as ["08:00", "20:00"], in timezone |
With 300 seconds, the steps of BATCH_WINDOW fall on every full 5 minutes: a node mined at 12:03 comes
back at 12:05, one mined at 12:04:50 too.
Cooldown look
cooldownVisual.placeholderMode | While on cooldown, the block is |
|---|---|
AIR | Gone |
CONFIGURED_MATERIAL (default) | placeholderMaterial, STONE by default |
AGE_ZERO_IF_POSSIBLE | A crop is replanted at its first stage; other blocks use placeholderMaterial |
Drops
| Key | Default | Meaning |
|---|---|---|
dropNaturalItems | false | Also drop what the block drops in vanilla |
dropNaturalExperience | false | Also drop its vanilla XP |
extraExperience | 0 | XP added on top |
allowSilkTouchNaturalDrops | true | With natural drops on, a silk touch tool drops the block itself |
Rewards
Rewards are lines with four parts, separated by ;.
| List | Line | Works like |
|---|---|---|
rewardPool | weight ; message ; type ; payload | One line is picked per roll, by weight. rollsPerBreak rolls per mined node |
chanceRewards | chance ; message ; type ; payload | Each line is rolled on its own. chance is from 0 to 1: 0.05 is 5 % |
| Type | Payload | Gives |
|---|---|---|
MONEY | An amount: 500 | Money through Vault |
EXPERIENCE or XP | An amount: 20 | Experience points |
CONSOLE_COMMAND or COMMAND | A command without / | Runs it from the console |
PLAYER_COMMAND | A command without / | Runs it as the player |
ITEM | MATERIAL,amount,drop: DIAMOND,2,false | The item. drop true drops it on the block, false puts it in the inventory |
Payloads can use {player}, {uuid} and {world}, and commands PlaceholderAPI. The message is sent
to the player; leave it empty for none. {profile} in it is the profile's display name.
Zones
zones:
- id: mine
enabled: true
displayName: "<gold>Mine"
priority: 100
protectUnmanagedBlocks: true
wgBuildBypass: false
scope:
worlds: []
worldGuardRegions:
- mine
cuboids:
- world: world
minX: 100
minY: 0
minZ: 100
maxX: 200
maxY: 80
maxZ: 200
profiles:
- profileId: diamond-1
enabled: true
priority: 100
restoreOverride:
enabled: true
mode: DAILY_TIMES
dailyTimes: ["20:00"]
| Key | Default | Meaning |
|---|---|---|
id, displayName | The zone's id and name, {zone} in announcements | |
priority | 100 | Where zones overlap, the higher wins |
protectUnmanagedBlocks | true | Players cannot break blocks in the zone that are not nodes |
wgBuildBypass | false | Let players mine nodes where WorldGuard denies building. Off, WorldGuard decides |
scope.worlds | dungeon | Whole worlds, when no region or cuboid is set |
scope.worldGuardRegions | empty | WorldGuard regions |
scope.cuboids | empty | Boxes of coordinates |
profiles | The profiles active in this zone |
Each profile binding has profileId, enabled, priority and a restoreOverride. With
restoreOverride.enabled: true, the zone uses its own restore settings for that profile instead of
the profile's, so one profile can come back every 5 minutes in one zone and once a day in another.
defaultZoneId names the zone the menu opens first.
Reset announcements
announcements warns players before a DAILY_TIMES reset.
| Key | Default | Meaning |
|---|---|---|
enabled | false | Turns announcements on |
minutesBefore | 60, 30, 10, 5, 1 | When to warn |
message | Nodes in {zone} will reset in {minutes} minutes. | The text |
broadcastType | CHAT | CHAT, TITLE or ACTION_BAR |
titleSubtitle, titleFadeIn, titleStay, titleFadeOut | For TITLE |
Performance
| Key | Default | Meaning |
|---|---|---|
scheduler.processIntervalTicks | 10 | How often due nodes are put back |
scheduler.maxBlocksPerRun, maxChunksPerRun | 128, 24 | Limits per run, so a big reset is spread over several ticks |
scheduler.loadChunksOnRestore | false | Load chunks to restore nodes in them. Off, nodes in unloaded chunks come back when the chunk loads |
scheduler.staleProgressCleanupHours | 24 | Half-mined nodes untouched for this long are forgotten. 0 keeps them |
database.flushIntervalTicks, batchSize | 20, 250 | How often and how many node changes are written |
wgRegionCacheTtlSeconds | 8 | How long WorldGuard region answers are cached |
timezone | Europe/Istanbul | For DAILY_TIMES |
Commands
All need uxmpvpcore.blockregen.admin.
| Command | Does |
|---|---|
/blockregen gui | A menu of zones, profiles and nodes |
/blockregen status | How many nodes are tracked and on cooldown |
/blockregen admin reload | Reads BlockRegen.yml again |
/blockregen admin reset (all, zone <id>, profile <id>) | Puts nodes back now |
/blockregen admin purge (all, zone <id>, profile <id>) | Forgets nodes without putting them back: the blocks stay as they are |
/blockregen admin info (zone <id>, profile <id>) | Detailed numbers |
Related: Extensions, Integrations
Was this page helpful?