物品拾取范围模组
扩展版
Minecraft 版本: 1.20.1
Fabric 加载器版本: 0.16.14+
原作者: wenhao
本版本作者: Arona74
许可证: MIT
描述
Item Pick-Up Range 模组允许玩家调整在 Minecraft 中自动拾取物品的距离(默认为 1.0)。每位玩家可以单独设置自己的拾取半径,服务器管理员可以定义可配置的最小和最大限制,以保持范围的平衡。
该模组支持按玩家自定义,值会在会话之间持久保存,并且在更改配置限制时会自动调整现有玩家的数值。
功能
- 按玩家设置拾取范围 – 每位玩家可以设置自己的范围。
- 可配置的限制 – 服务器管理员可以在 JSON 配置文件中定义
minPickupRange 和 maxPickupRange。
- 自动钳制 – 如果玩家的范围超出新的配置限制,系统会自动进行调整。
- 持久化值 – 玩家拾取范围会保存到 NBT 并在加载时读取。
- 简单的命令 – 所有功能都可以通过一个根命令访问:
/PickupRange。
安装
- 为 Minecraft 1.20.1 安装 Fabric Loader 0.16.14+。
- 为 Minecraft 1.20.1 安装 Fabric API。
- 将此模组的编译后的
.jar 文件放入你的 mods/ 文件夹中。
- 使用 Fabric 配置文件启动 Minecraft。
配置
模组配置存储在以下位置:
config/item_pickup_range.json
{
"minPickupRange": 0.5,
"maxPickupRange": 5.0
}
- minPickupRange: 允许的最小拾取范围
- maxPickupRange: 允许的最大拾取范围
更改值并重新加载配置后,会自动调整玩家当前的范围。
命令
所有命令都在根命令 /PickupRange 之下:
| 命令 |
描述 |
权限 |
/PickupRange set <value> |
设置你个人的物品拾取范围(在配置的限制内) |
所有玩家 |
/PickupRange get |
显示你当前的拾取范围 |
所有玩家 |
/PickupRange reload |
重新加载配置并钳制所有玩家的范围 |
仅限 OP(权限等级 2) |
工作原理
- 玩家的范围是单独存储并保存到 NBT 的,因此它们会在会话之间持久保存。
- 当服务器启动或重新加载配置时,模组会自动钳制玩家的数值。
- 如果由于新限制而调整了玩家的拾取范围,玩家会收到通知。
开发
- 语言:Java
- 构建系统:Gradle 配合 Fabric Loom
- 使用 Mixins 将拾取范围逻辑注入到
PlayerEntity 中。
许可证
本模组根据 MIT 许可证 发布。你可以自由使用、修改和重新分发它,只要包含许可证条款即可。
Item Pick-Up Range Mod
Extended Edition
Minecraft Version: 1.20.1
Fabric Loader Version: 0.16.14+
Original Author: wenhao
This version Author: Arona74
License: MIT
Description
The Item Pick-Up Range mod allows players to adjust the range at which they automatically pick up items in Minecraft (default is 1.0). Each player can set their own pickup radius individually, and server admins can define configurable minimum and maximum limits to keep ranges balanced.
The mod supports per-player customization, persists values between sessions, and automatically clamps existing player values when configuration limits are changed.
Features
- Per-player pickup range – Each player can set their own range.
- Configurable limits – Server admins can define
minPickupRange and maxPickupRange in a JSON config file.
- Automatic clamping – Player ranges are automatically adjusted if they exceed new config limits.
- Persistent values – Player pickup ranges are saved and loaded from NBT.
- Simple commands – All features accessible through one root command:
/PickupRange.
Installation
- Install Fabric Loader 0.16.14+ for Minecraft 1.20.1.
- Install the Fabric API for Minecraft 1.20.1.
- Place the compiled
.jar of this mod into your mods/ folder.
- Launch Minecraft with the Fabric profile.
Configuration
The mod configuration is stored in:
config/item_pickup_range.json
{
"minPickupRange": 0.5,
"maxPickupRange": 5.0
}
- minPickupRange: minimum allowed pickup range
- maxPickupRange: maximum allowed pickup range
Changing the values and reloading the config automatically adjusts players' current ranges.
Commands
All commands are under the root command: /PickupRange
| Command |
Description |
Permissions |
/PickupRange set <value> |
Set your personal item pickup range (within configured limits) |
All players |
/PickupRange get |
Display your current pickup range |
All players |
/PickupRange reload |
Reload the config and clamp all players’ ranges |
OP only (permission level 2) |
How it works
- Player ranges are stored individually and saved to NBT, so they persist between sessions.
- The mod automatically clamps player values when the server starts or when the config is reloaded.
- Players are notified if their pickup range is adjusted due to new limits.
Development
- Language: Java
- Build System: Gradle with Fabric Loom
- Mixins used for injecting pickup range logic into
PlayerEntity.
License
This mod is released under the MIT License. You are free to use, modify, and redistribute it, as long as the license terms are included.
评论 0
登录后参与评分
还没有评论,来抢沙发吧