RA-MinerRegen

A dungeon mining system for Paper 1.21.x: only whitelisted ores can be mined inside managed worlds or regions, and mined blocks regenerate after a cooldown, with command blocking and PlaceholderAPI support.

Author: RajaAditya Website: rajaaditya.my.id Version: 1.0.0 API: Paper 1.21.x


Features

Mining Areas

  • Pick a mode in config.yml:
    • WORLD applies the rules to every world in whitelist-worlds
    • REGION applies them only inside regions you create with a selection wand
  • Regions are created with a wand (left click = position 1, right click = position 2) and a name, and are stored in SQLite

Whitelist and Regeneration

  • Only blocks in whitelist-blocks can be broken in a managed area. Everything else is protected
  • A mined ore is replaced and then regenerates after cooldown-seconds
  • Two cooldown modes:
    • PER_ORE gives every mined block its own timer
    • GLOBAL resets all waiting blocks together on one repeating timer
  • The check interval is configurable, with a default of one second (20 ticks)

Anti-Exploit

  • prevent-block-place stops players from placing blocks in managed areas, which closes the "place, break, repeat" trick that would farm cooldown resets
  • A command blacklist (for example home, tpa, spawn) blocks escape commands while a player is inside a managed area
  • Staff with minerregen.bypass.blacklist are not affected by the blacklist

Placeholder for Scoreboards

  • A countdown to the next global regeneration can be shown in a scoreboard or tab

Dependencies

PluginRequiredPurpose
PlaceholderAPINo (softdepend)Enables %minerregen_*% placeholders

Installation

  1. Place RA-MinerRegen.jar into your plugins/ folder
  2. Restart the server
  3. In REGION mode, run /minerregen wand and select two corners, then create a region with /minerregen region create <name>
  4. Edit config.yml and messages.yml, then run /minerregen reload

File Structure

text
1
plugins/RA-MinerRegen/
├── config.yml       # Mode, whitelist, cooldowns, blacklist
├── messages.yml     # All messages
└── (SQLite file)    # Saved regions

Configuration

config.yml

yaml
1
mode: REGION                  # WORLD or REGION

whitelist-worlds:             # used only in WORLD mode
  - dungeon_world

cooldown-seconds: 60
cooldown-mode: PER_ORE        # PER_ORE or GLOBAL

whitelist-blocks:
  - COAL_ORE
  - IRON_ORE
  - GOLD_ORE
  - DIAMOND_ORE
  - EMERALD_ORE
  - LAPIS_ORE
  - REDSTONE_ORE
  - DEEPSLATE_COAL_ORE
  # ...and the other deepslate ores

prevent-block-place: true
regen-check-interval: 20      # ticks

blacklist-commands:           # without the slash
  - home
  - tpa
  - spawn

messages.yml (excerpt)

yaml
1
prefix: "&8[&bMinerRegen&8] &r"
block-not-whitelisted: "&cYou cannot break that block here."
place-blocked: "&cYou cannot place blocks in this area."
wand-given: "&aRegion wand given. Left click = pos1, right click = pos2."
region-created: "&aRegion &f{name} &acreated."
command-blocked: "&cThe command {command} cannot be used in this area."

Position and region messages use {x}, {y}, {z}, and {name}.


Commands

The main command is /minerregen (alias /mr).

CommandDescriptionAccess
/minerregen wandGet the region selection wandAdmin
/minerregen region create <name>Create a region from your two selected positionsAdmin
/minerregen region delete <name>Delete a regionAdmin
/minerregen region listList regionsAdmin
/minerregen reloadReload config and messagesAdmin

Permissions

PermissionDefaultDescription
minerregen.adminopUse the admin commands (wand, region, reload)
minerregen.bypass.blacklistopIgnore the command blacklist in managed areas

PlaceholderAPI

Requires PlaceholderAPI. Identifier: minerregen.

PlaceholderDescription
%minerregen_timereset_global%Countdown to the next global regeneration as HH:MM:SS, or N/A when cooldown-mode is not GLOBAL

License

Developed by RajaAditya — rajaaditya.my.id