DUXPLIMA Documentation

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:

IdeaSays
ProfileWhat a node is: which blocks, how many hits, what it gives, how it comes back
ZoneWhere 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.

Check the default 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

  1. The player breaks a node block. The block does not break the vanilla way.
  2. With requiredBreaks above 1, it takes that many breaks before anything else happens.
  3. The player gets the profile's rewards and XP, and the block turns into its cooldown look.
  4. 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"
KeyDefaultMeaning
idThe profile's id, used by zones and commands
enabledtrueOff, its blocks are not nodes
displayNameShown in menus and as {profile} in reward messages
priority100When two profiles claim the same material, the higher wins
materialsThe blocks that are nodes
requiredPermissionemptyA permission needed to mine these nodes. Empty for everyone
noPermissionMessageSent to players without it
mining.requiredBreaks1Breaks needed before the node pays and goes on cooldown
mining.requireFullyGrownAgeabletrueCrops count only when fully grown

Coming back

restore.modeThe node comes back
INDIVIDUALcooldownSeconds (300) after it was mined, each node on its own
BATCH_WINDOWAt the next full step of batchWindowSeconds (300) on the clock. All nodes mined within one step come back together
FIXED_INTERVALAt the next full step of fixedIntervalSeconds (600) on the clock
DAILY_TIMESAt 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.placeholderModeWhile on cooldown, the block is
AIRGone
CONFIGURED_MATERIAL (default)placeholderMaterial, STONE by default
AGE_ZERO_IF_POSSIBLEA crop is replanted at its first stage; other blocks use placeholderMaterial

Drops

KeyDefaultMeaning
dropNaturalItemsfalseAlso drop what the block drops in vanilla
dropNaturalExperiencefalseAlso drop its vanilla XP
extraExperience0XP added on top
allowSilkTouchNaturalDropstrueWith natural drops on, a silk touch tool drops the block itself

Rewards

Rewards are lines with four parts, separated by ;.

ListLineWorks like
rewardPoolweight ; message ; type ; payloadOne line is picked per roll, by weight. rollsPerBreak rolls per mined node
chanceRewardschance ; message ; type ; payloadEach line is rolled on its own. chance is from 0 to 1: 0.05 is 5 %
TypePayloadGives
MONEYAn amount: 500Money through Vault
EXPERIENCE or XPAn amount: 20Experience points
CONSOLE_COMMAND or COMMANDA command without /Runs it from the console
PLAYER_COMMANDA command without /Runs it as the player
ITEMMATERIAL,amount,drop: DIAMOND,2,falseThe 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"]
KeyDefaultMeaning
id, displayNameThe zone's id and name, {zone} in announcements
priority100Where zones overlap, the higher wins
protectUnmanagedBlockstruePlayers cannot break blocks in the zone that are not nodes
wgBuildBypassfalseLet players mine nodes where WorldGuard denies building. Off, WorldGuard decides
scope.worldsdungeonWhole worlds, when no region or cuboid is set
scope.worldGuardRegionsemptyWorldGuard regions
scope.cuboidsemptyBoxes of coordinates
profilesThe 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.

KeyDefaultMeaning
enabledfalseTurns announcements on
minutesBefore60, 30, 10, 5, 1When to warn
messageNodes in {zone} will reset in {minutes} minutes.The text
broadcastTypeCHATCHAT, TITLE or ACTION_BAR
titleSubtitle, titleFadeIn, titleStay, titleFadeOutFor TITLE

Performance

KeyDefaultMeaning
scheduler.processIntervalTicks10How often due nodes are put back
scheduler.maxBlocksPerRun, maxChunksPerRun128, 24Limits per run, so a big reset is spread over several ticks
scheduler.loadChunksOnRestorefalseLoad chunks to restore nodes in them. Off, nodes in unloaded chunks come back when the chunk loads
scheduler.staleProgressCleanupHours24Half-mined nodes untouched for this long are forgotten. 0 keeps them
database.flushIntervalTicks, batchSize20, 250How often and how many node changes are written
wgRegionCacheTtlSeconds8How long WorldGuard region answers are cached
timezoneEurope/IstanbulFor DAILY_TIMES

Commands

All need uxmpvpcore.blockregen.admin.

CommandDoes
/blockregen guiA menu of zones, profiles and nodes
/blockregen statusHow many nodes are tracked and on cooldown
/blockregen admin reloadReads 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