RefreshLoot
A plugin for refreshing world contents item一个用于刷新世界内容器物品的插件
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
RefreshLoot
RefreshLoot - Loot Refresh Plugin
Plugin Information
- API Version: RefreshLoot - API Version: 1.0.0 - API Version: 114514h - API Version: Minecraft 1.21.4 - API Version: Spigot 1.21
Function Description
RefreshLoot is a plugin designed to refresh items in containers across the world. Administrators can use commands to refresh random slots in all containers, including chests, trapped chests, large chests, barrels, furnaces, hoppers, and more.
Main Features
- Highly Configurable: Randomly selects container slots for item refreshing. - Highly Configurable: Option to clear all items in containers before refreshing. - Highly Configurable: Supports hot-reloading configuration files without server restart. - Highly Configurable: Compatible with chests, trapped chests, large chests, barrels, furnaces, hoppers, etc. - Highly Configurable: Avoids server lag and ensures smooth operation. - Highly Configurable: Customizable refresh items, quantities, container types, etc.
Commands
- `/refreshloot` or `/rloot` - Refresh random slots in all containers across the world. - `/refreshloot reload` or `/rloot reload` - Reload the configuration file. - Permission: `refreshloot.admin` (default OP permission)
Configuration Instructions
Basic Settings
```yaml settings: debug: false # Whether to enable debug mode refresh-interval: 300 # Refresh interval in seconds random-slots: 3 # Number of random slots to refresh each time clear-containers: true # Whether to clear container contents before refreshing ```
Container Clearing Explanation: - `clear-containers: true` - Clears all items in containers before adding new random items. - `clear-containers: false` - Retains existing items in containers and only adds new items to randomly selected slots. - Recommended setting: `true` for better refresh results.
Container Configuration
Each container type can be configured individually: - `enabled`: Whether to enable refreshing for this container type. - `refresh-slots`: Number of slots to refresh each time. - `items`: List of possible items to refresh.
Item Format
Item configuration format: `MATERIAL:min-max` - `DIAMOND:1-3` - Diamonds, quantity 1-3. - `BREAD:2-5` - Bread, quantity 2-5. - `IRON_SWORD:1` - Iron Sword, fixed quantity of 1.
Important Note: In Minecraft 1.21.4, the names of golden equipment have been changed: - `GOLD_HELMET` → `GOLDEN_HELMET` - `GOLD_CHESTPLATE` → `GOLDEN_CHESTPLATE` - `GOLD_LEGGINGS` → `GOLDEN_LEGGINGS` - `GOLD_BOOTS` → `GOLDEN_BOOTS`
Refer to the `MATERIAL_NAMES.md` file for a detailed list of item names.
Supported Container Types
- Hopper (chest) - Regular chest - Hopper (trapped_chest) - Trapped chest - Hopper (large_chest) - Double chest - Hopper (barrel) - Barrel - Hopper (furnace) - Furnace, blast furnace, smoker - Hopper (hopper) - Hopper
Installation Method
1. Place the compiled `RefreshLoot-1.0.0.jar` file into the server's `plugins` folder. 2. Restart the server or use the `/reload` command. 3. The plugin will automatically generate a configuration file `config.yml`. 4. Modify the configuration file as needed. 5. Use the `/rloot` command to start refreshing containers.
Reload Functionality
The plugin supports hot-reloading configuration files without restarting the server:
Usage
``` /rloot reload ```
Reload Features
- Asynchronous Processing: Changes take effect immediately after modifying the configuration file. - Asynchronous Processing: Includes error handling to prevent plugin failure during reload. - Asynchronous Processing: Displays reload configuration status when debug mode is enabled. - Asynchronous Processing: Reload process does not block the server's main thread.
When to Reload
- After modifying container configurations. - After adjusting the item refresh list. - After changing plugin settings. - After updating message configurations.
Notes
- The plugin scans all chunks in the world to find containers, which may take a long time in large worlds. - It is recommended to use the refresh command during periods of low server load. - Customize items and quantities for each container type in the configuration file. - Enable debug mode to view detailed refresh information.
Permissions
- `refreshloot.admin` - Allows the use of loot refresh commands (default OP permission)
RefreshLoot - 物资刷新插件
插件信息
- API版本: RefreshLoot - API版本: 1.0.0 - API版本: 114514h - API版本: Minecraft 1.21.4 - API版本: Spigot 1.21
功能描述
RefreshLoot 是一个用于刷新世界内容器物品的插件。管理员可以使用命令来刷新世界内所有容器的随机槽位,包括箱子、陷阱箱、大箱子、木桶、熔炉、漏斗等。
主要特性
- 高度可配置: 随机选择容器中的槽位进行物品刷新 - 高度可配置: 可选择在刷新前清除容器中的所有物品 - 高度可配置: 支持热重载配置文件,无需重启服务器 - 高度可配置: 支持箱子、陷阱箱、大箱子、木桶、熔炉、漏斗等 - 高度可配置: 避免服务器卡顿,确保流畅运行 - 高度可配置: 可自定义刷新物品、数量、容器类型等
命令
- `/refreshloot` 或 `/rloot` - 刷新世界内所有容器的随机槽位 - `/refreshloot reload` 或 `/rloot reload` - 重新加载配置文件 - 权限: `refreshloot.admin` (默认OP权限)
配置说明
基本设置
```yaml settings: debug: false # 是否启用调试模式 refresh-interval: 300 # 刷新间隔(秒) random-slots: 3 # 每次刷新时随机刷新的槽位数量 clear-containers: true # 是否在刷新前清除容器内容 ```
清除容器功能说明: - `clear-containers: true` - 在刷新物品前先清除容器中的所有物品,然后添加新的随机物品 - `clear-containers: false` - 保留容器中的现有物品,只在随机选择的槽位中添加新物品 - 建议设置为 `true` 以获得更好的刷新效果
容器配置
每个容器类型都可以单独配置: - `enabled`: 是否启用该容器类型的刷新 - `refresh-slots`: 每次刷新时刷新的槽位数量 - `items`: 可能刷新的物品列表
物品格式
物品配置格式:`MATERIAL:min-max` - `DIAMOND:1-3` - 钻石,数量1-3个 - `BREAD:2-5` - 面包,数量2-5个 - `IRON_SWORD:1` - 铁剑,固定1个
重要提示: 在Minecraft 1.21.4版本中,金质装备的名称已更改: - `GOLD_HELMET` → `GOLDEN_HELMET` - `GOLD_CHESTPLATE` → `GOLDEN_CHESTPLATE` - `GOLD_LEGGINGS` → `GOLDEN_LEGGINGS` - `GOLD_BOOTS` → `GOLDEN_BOOTS`
详细物品名称对照表请参考 `MATERIAL_NAMES.md` 文件。
支持的容器类型
- 漏斗 (chest) - 普通箱子 - 漏斗 (trapped_chest) - 陷阱箱 - 漏斗 (large_chest) - 双箱子 - 漏斗 (barrel) - 木桶 - 漏斗 (furnace) - 熔炉、高炉、烟熏炉 - 漏斗 (hopper) - 漏斗
安装方法
1. 将编译好的 `RefreshLoot-1.0.0.jar` 文件放入服务器的 `plugins` 文件夹 2. 重启服务器或使用 `/reload` 命令 3. 插件会自动生成配置文件 `config.yml` 4. 根据需要修改配置文件 5. 使用 `/rloot` 命令开始刷新容器
重载功能
插件支持热重载配置文件,无需重启服务器:
使用方法
``` /rloot reload ```
重载功能特点
- 异步处理: 修改配置文件后立即生效 - 异步处理: 包含错误处理,重载失败不会影响插件运行 - 异步处理: 启用调试模式时显示重载后的配置状态 - 异步处理: 重载过程不会阻塞服务器主线程
重载时机
- 修改容器配置后 - 调整刷新物品列表后 - 更改插件设置后 - 更新消息配置后
```
注意事项
- 插件会扫描世界中的所有区块来查找容器,在大世界中可能需要较长时间 - 建议在服务器负载较低时使用刷新命令 - 可以通过配置文件自定义每种容器刷新的物品和数量 - 启用调试模式可以查看详细的刷新信息
权限
- `refreshloot.admin` - 允许使用物资刷新命令(默认OP权限)