DungeonRefresher
在可配置的冷却时间后,自动重新生成箱子、木桶和试炼宝库中的战利品。
非常适合自定义地牢、冒险地图以及需要可再生战利品的多人服务器。
⚙️ 核心机制
- 首次打开 – 会存储一个随机冷却时间(介于最小值和最大值分钟数之间)。
- 冷却结束 – 容器内的战利品将在下次打开时完全重新生成。
- 自定义战利品表 – 使用
/dr setloot 分配任何原版战利品表(例如 minecraft:chests/simple_dungeon)。
- 持久化数据 – 冷却时间和自定义战利品分配使用 PersistentDataContainer 保存,重启服务器后依然保留。
✨ 功能特性
- 以分钟为单位配置最小/最大冷却时间(默认 24–96 小时)。
- 选择受影响的容器类型(箱子、木桶、试炼宝库)。
- 填充前清空物品栏(可配置)。
- 存储选项:PDC(持久化)或内存中的 Caffeine 缓存。
- 保护系统 – 防止在冷却期间破坏容器(附带绕过权限)。
- 子命令及所有原版箱子/发射器战利品表的 Tab 补全支持。
? 命令与权限
| 命令 |
权限节点 |
/dr reload |
dungeonrefresher.reload |
/dr debug |
dungeonrefresher.debug |
/dr reset |
dungeonrefresher.reset |
/dr setloot <key> |
dungeonrefresher.setloot |
/dr resetloot |
dungeonrefresher.resetloot |
别名:/dungeonrefresher。所有权限默认赋予 OP。
? 配置
带有详细注释的 config.yml:
# 刷新时间设置(单位:分钟)
refresh:
# 战利品重新生成前的最小冷却时间(单位:分钟)
# 默认:1440 分钟 = 24 小时
min-minutes: 1440
# 战利品重新生成前的最大冷却时间(单位:分钟)
# 默认:5760 分钟 = 96 小时
max-minutes: 5760
# 要处理的容器类型
features:
# 试炼宝库(需要 Paper 1.21+)
vaults: true
# 普通箱子和陷阱箱
chests: true
# 木桶
barrels: true
# 在填充新战利品前清空物品栏(如果为 false,新战利品将与现有物品合并)
clear-inventory-on-refresh: true
# 冷却时间存储方式
storage:
# true = 使用 PersistentDataContainer(存储在方块内部,重启服务器后保留)
# false = 使用内存中的 Caffeine 缓存(重启后重置,速度更快但易失)
use-persistent-data-container: true
# 保护设置(冷却结束前防止破坏容器)
protection:
# 启用战利品容器的保护(处于冷却期间玩家无法破坏它们)
enabled: false
# 用于绕过保护的权限
bypass-permission: "dungeonrefresher.bypass"
# 防止爆炸摧毁容器
protect-from-explosions: true
? 安装方法
- 将 DungeonRefresher.jar 放入你的 plugins/ 文件夹中。
- 重启服务器或加载插件。
- (可选)根据需要编辑 config.yml 并运行 /dr reload。
DungeonRefresher
Automatically regenerates loot in chests, barrels, and trial vaults after a configurable cooldown.
Perfect for custom dungeons, adventure maps, and multiplayer servers where loot needs to be renewable.
⚙️ Core Mechanics
- First open – a random cooldown (between min and max minutes) is stored.
- Cooldown expired – the container's loot is completely regenerated on the next open.
- Custom loot tables – assign any vanilla loot table (e.g.
minecraft:chests/simple_dungeon) using /dr setloot.
- Persistent data – cooldowns and custom loot assignments survive server restarts using PersistentDataContainer.
✨ Features
- Configure min/max cooldown in minutes (default 24–96 hours).
- Choose which container types are affected (chests, barrels, trial vaults).
- Clear inventory before refilling (configurable).
- Storage options: PDC (persistent) or in-memory Caffeine cache.
- Protection system – prevent breaking containers while on cooldown (with bypass permission).
- Tab completion for subcommands and all vanilla chest/dispenser loot tables.
? Commands & Permissions
| Command |
Permission |
/dr reload |
dungeonrefresher.reload |
/dr debug |
dungeonrefresher.debug |
/dr reset |
dungeonrefresher.reset |
/dr setloot <key> |
dungeonrefresher.setloot |
/dr resetloot |
dungeonrefresher.resetloot |
Alias: /dungeonrefresher. All permissions default to op.
? Configuration
Detailed config.yml with comments:
# Refresh timing settings (in minutes)
refresh:
# Minimum cooldown before loot can be regenerated (in minutes)
# Default: 1440 minutes = 24 hours
min-minutes: 1440
# Maximum cooldown before loot can be regenerated (in minutes)
# Default: 5760 minutes = 96 hours
max-minutes: 5760
# Which container types to process
features:
# Trial Vaults (requires Paper 1.21+)
vaults: true
# Normal chests and trapped chests
chests: true
# Barrels
barrels: true
# Clear inventory before filling with new loot (if false, new loot will be merged with existing items)
clear-inventory-on-refresh: true
# Cooldown storage method
storage:
# true = use PersistentDataContainer (stored inside the block, survives server restarts)
# false = use in-memory Caffeine cache (resets on restart, faster but volatile)
use-persistent-data-container: true
# Protection settings (prevent breaking containers before cooldown expires)
protection:
# Enable protection for loot containers (players cannot break them while on cooldown)
enabled: false
# Permission to bypass protection
bypass-permission: "dungeonrefresher.bypass"
# Prevent explosions from destroying containers
protect-from-explosions: true
? Installation
- Place DungeonRefresher.jar into your plugins/ folder.
- Restart the server or load the plugin.
- (Optional) Edit config.yml if needed and run /dr reload.
评论 0
登录后参与评分
还没有评论,来抢沙发吧