Drwei 的宠物管理器
一款功能强大且特性丰富的 Paper Minecraft 服务器宠物管理插件。此插件允许玩家将生物绑定为宠物,并支持自定义名称、颜色、行为、药水效果、属性、队伍共享,以及诸如 TRUCK 碰撞伤害模式和 RIDEABLE(可骑乘)模式等高级功能。
功能特性
核心功能
- 宠物绑定:将任何活体实体绑定为你的宠物,并支持自定义名称和颜色
- 自定义名称与颜色:支持 Minecraft 颜色代码、颜色名称以及十六进制颜色值
- 行为模式:跟随、停留、攻击、守卫、漫游
- 药水效果:为宠物施加自定义药水效果
- 属性修改:修改宠物的生命值、速度、伤害等属性
- 宠物重生:让死亡的宠物重生,并保留所有数据
- 队伍系统:与队伍成员共享宠物
高级功能
- TRUCK 模式:骑乘宠物时的碰撞伤害系统
- 普通模式:基于速度造成伤害(0-255)
- SECKILL 模式:固定造成 255 点伤害
- RIDEABLE 模式:骑乘任何生物,包括飞行生物
- 使用 WASD 键控制移动
- 空格键跳跃/向上飞行
- Shift 键退出骑乘
- 飞行生物支持垂直移动
- 无敌模式:施加所有正面药水效果并将最大生命值设置为 2048
- 自动保存:每 5 分钟自动持久化数据
- 动态配置:无需重启服务器即可调整设置
- 多语言支持:英语和中文
安装
- 从 Releases 页面或此 Modrinth 页面下载最新版本。
- 将
DrweiPetManager-<version>.jar 文件放入服务器的 plugins 文件夹中
- 重启服务器
- 在
plugins/DrweiPetManager/config.yml 中配置插件
要求
- Minecraft 版本:1.21.1
- 服务器类型:Paper API 1.21.1 或更高版本
- Java 版本:21
命令
玩家命令
| 命令 |
描述 |
权限 |
/pet |
显示帮助信息 |
petbinder.use |
/pet bind <type> <distance> <name> [public] [color] |
将生物绑定为宠物 |
petbinder.bind |
/pet list |
列出你的宠物 |
petbinder.list |
/pet portal [index] |
将宠物传送到你身边 |
petbinder.portal |
/pet rename <index> <name> [color] |
重命名宠物 |
petbinder.rename |
| `/pet team <create |
join |
leave |
| `/pet behavior <index> <follow |
stay |
attack |
/pet effect <index> <effect|invincible> [duration] [amplifier] |
施加药水效果 |
petbinder.effect |
/pet attribute <index> [attribute] [value] |
修改宠物属性 |
petbinder.attribute |
/pet unbind [index] |
释放宠物 |
petbinder.unbind |
/pet respawn |
重生死亡的宠物 |
petbinder.respawn |
/pet version |
显示插件版本 |
petbinder.use |
管理员命令
| 命令 |
描述 |
权限 |
/pet op list |
列出服务器上所有宠物 |
petbinder.op |
/pet op remove <player> |
移除玩家的所有宠物 |
petbinder.op |
/pet op config <action> [args] |
动态配置 |
petbinder.op |
/pet op reload |
重新加载配置 |
petbinder.op |
/pet op save |
手动保存宠物数据 |
petbinder.op |
/pet op load |
手动加载宠物数据 |
petbinder.op |
配置
基础配置
language: zh # 语言:en 或 zh
max-bind-distance: 10 # 最大绑定距离(方块数)
teleport-with-owner: true # 宠物随主人传送
protect-from-all-damage: false # 保护宠物免受所有伤害
remove-on-quit: false # 主人退出时移除宠物
权限与限制
permissions:
max-pets-per-player: 0 # 0 = 无限制
allowed-commands:
bind: true
list: true
portal: true
rename: true
team: true
behavior: true
effect: true
attribute: true
unbind: true
respawn: true
allowed-features:
truck: true
rideable: true
invincible: true
seckill: true
public-pets: true
team-system: true
blocked-entity-types: [] # 不可绑定的实体类型
max-truck-damage: 0 # 0 = 无限制
使用示例
绑定宠物
/pet bind nearest 10 MyPet public &a
这将把 10 个方块内的最近生物绑定为名为“MyPet”的绿色宠物。
设置宠物行为
/pet behavior 1 follow
这将把宠物 #1 设置为跟随模式。
使宠物无敌
/pet effect 1 invincible
这将给宠物 #1 施加所有正面药水效果。
启用 TRUCK 模式
/pet attribute 1 truck 0.5 false
这将给宠物 #1 启用 TRUCK 模式,最低速度为每秒 0.5 个方块。
启用 SECKILL 模式
/pet attribute 1 truck 0.5 true
这将给宠物 #1 启用 SECKILL 模式(固定造成 255 点伤害)。
使宠物可骑乘
/pet attribute 1 rideable
这将给宠物 #1 启用可骑乘模式。
创建队伍
/pet team create MyTeam
这将创建一个名为“MyTeam”的新队伍。
将宠物加入队伍
/pet team addpet MyTeam 1
这将把宠物 #1 添加到“MyTeam”队伍中。
数据持久化
该插件使用双重存储机制:
- NBT 持久化:实时存储在实体 NBT 数据中
- 文件持久化:YAML 文件存储于
plugins/DrweiPetManager/pets.yml
自动保存每 5 分钟运行一次。你也可以使用管理员命令手动保存/加载数据。
从源代码构建
前置条件
构建命令
# 克隆仓库
git clone https://github.com/herbrine8403/DrweiPetManager.git
cd DrweiPetManager
# 构建插件
mvn clean package
# JAR 文件将位于 target/DrweiPetManager-Beta0.1.0.jar
权限
所有权限均使用前缀 petbinder.:
petbinder.use - 基本使用权限
petbinder.bind - 绑定宠物
petbinder.list - 列出宠物
petbinder.portal - 传送宠物
petbinder.rename - 重命名宠物
petbinder.team - 管理团队
petbinder.respawn - 重生宠物
petbinder.behavior - 设置宠物行为
petbinder.effect - 添加药水效果
petbinder.attribute - 修改属性
petbinder.unbind - 释放宠物
petbinder.op - 管理员命令(默认:仅限 OP)
支持
许可证
本项目采用 MIT 许可证授权 - 详情请参阅 LICENSE 文件。
致谢
更新日志
Beta0.1.0
- 初始测试版发布
- 核心宠物绑定与管理功能
- 团队系统
- TRUCK 模式,支持 SECKILL
- RIDEABLE 模式
- 自动保存机制
- 动态配置
- 多语言支持(英文/中文)
Drwei's PetManager
A powerful and feature-rich pet management plugin for Paper Minecraft servers. This plugin allows players to bind mobs as pets with custom names, colors, behaviors, potion effects, attributes, team sharing, and advanced features like TRUCK collision damage mode and RIDEABLE mode.
Features
Core Features
- Pet Binding: Bind any living entity as your pet with custom name and color
- Custom Names & Colors: Support for Minecraft color codes, color names, and hex colors
- Behavior Modes: follow, stay, attack, guard, wander
- Potion Effects: Apply custom potion effects to pets
- Attribute Modification: Modify pet attributes like health, speed, damage, etc.
- Pet Respawn: Respawn dead pets with all their data preserved
- Team System: Share pets with team members
Advanced Features
- TRUCK Mode: Collision damage system when riding pets
- Normal mode: Damage based on speed (0-255)
- SECKILL mode: Always 255 damage
- RIDEABLE Mode: Ride any mob, including flying creatures
- WASD controls for movement
- Space to jump/fly up
- Shift to exit
- Flying creatures support vertical movement
- Invincible Mode: Apply all positive potion effects and set max health to 2048
- Auto-Save: Automatic data persistence every 5 minutes
- Dynamic Configuration: Adjust settings without server restart
- Multi-language Support: English and Chinese
Installation
- Download the latest version from the Releases page or this Modrinth page.
- Place the
DrweiPetManager-<version>.jar file in your server's plugins folder
- Restart your server
- Configure the plugin in
plugins/DrweiPetManager/config.yml
Requirements
- Minecraft Version: 1.21.1
- Server Type: Paper API 1.21.1 or higher
- Java Version: 21
Commands
Player Commands
| Command |
Description |
Permission |
/pet |
Show help message |
petbinder.use |
/pet bind <type> <distance> <name> [public] [color] |
Bind a mob as pet |
petbinder.bind |
/pet list |
List your pets |
petbinder.list |
/pet portal [index] |
Teleport pet to you |
petbinder.portal |
/pet rename <index> <name> [color] |
Rename pet |
petbinder.rename |
| `/pet team <create |
join |
leave |
| `/pet behavior <index> <follow |
stay |
attack |
/pet effect <index> <effect|invincible> [duration] [amplifier] |
Apply potion effects |
petbinder.effect |
/pet attribute <index> [attribute] [value] |
Modify pet attributes |
petbinder.attribute |
/pet unbind [index] |
Release pet |
petbinder.unbind |
/pet respawn |
Respawn dead pet |
petbinder.respawn |
/pet version |
Show plugin version |
petbinder.use |
Admin Commands
| Command |
Description |
Permission |
/pet op list |
List all pets on server |
petbinder.op |
/pet op remove <player> |
Remove all pets from player |
petbinder.op |
/pet op config <action> [args] |
Dynamic configuration |
petbinder.op |
/pet op reload |
Reload configuration |
petbinder.op |
/pet op save |
Save pet data manually |
petbinder.op |
/pet op load |
Load pet data manually |
petbinder.op |
Configuration
Basic Configuration
language: zh # Language: en or zh
max-bind-distance: 10 # Maximum binding distance in blocks
teleport-with-owner: true # Pets teleport with owner
protect-from-all-damage: false # Protect pets from all damage
remove-on-quit: false # Remove pets when owner quits
Permissions & Limits
permissions:
max-pets-per-player: 0 # 0 = unlimited
allowed-commands:
bind: true
list: true
portal: true
rename: true
team: true
behavior: true
effect: true
attribute: true
unbind: true
respawn: true
allowed-features:
truck: true
rideable: true
invincible: true
seckill: true
public-pets: true
team-system: true
blocked-entity-types: [] # Entities that cannot be bound
max-truck-damage: 0 # 0 = unlimited
Usage Examples
Binding a Pet
/pet bind nearest 10 MyPet public &a
This binds the nearest mob within 10 blocks as a pet named "MyPet" with green color.
Setting Pet Behavior
/pet behavior 1 follow
This sets pet #1 to follow mode.
Making Pet Invincible
/pet effect 1 invincible
This applies all positive potion effects to pet #1.
Enabling TRUCK Mode
/pet attribute 1 truck 0.5 false
This enables TRUCK mode for pet #1 with minimum speed 0.5 blocks/sec.
Enabling SECKILL Mode
/pet attribute 1 truck 0.5 true
This enables SECKILL mode (always 255 damage) for pet #1.
Making Pet Rideable
/pet attribute 1 rideable
This enables rideable mode for pet #1.
Creating a Team
/pet team create MyTeam
This creates a new team named "MyTeam".
Adding Pet to Team
/pet team addpet MyTeam 1
This adds pet #1 to the team "MyTeam".
Data Persistence
The plugin uses dual storage mechanism:
- NBT Persistence: Real-time storage in entity NBT data
- File Persistence: YAML file storage at
plugins/DrweiPetManager/pets.yml
Auto-save runs every 5 minutes. You can also manually save/load using admin commands.
Building from Source
Prerequisites
Build Commands
# Clone the repository
git clone https://github.com/herbrine8403/DrweiPetManager.git
cd DrweiPetManager
# Build the plugin
mvn clean package
# The JAR file will be in target/DrweiPetManager-Beta0.1.0.jar
Permissions
All permissions use the prefix petbinder.:
petbinder.use - Basic usage permission
petbinder.bind - Bind pets
petbinder.list - List pets
petbinder.portal - Teleport pets
petbinder.rename - Rename pets
petbinder.team - Manage teams
petbinder.respawn - Respawn pets
petbinder.behavior - Set pet behavior
petbinder.effect - Add potion effects
petbinder.attribute - Modify attributes
petbinder.unbind - Release pets
petbinder.op - Admin commands (default: OP only)
Support
- Issues: Report bugs and feature requests on GitHub Issues or my Email
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credits
Changelog
Beta0.1.0
- Initial beta release
- Core pet binding and management features
- Team system
- TRUCK mode with SECKILL support
- RIDEABLE mode
- Auto-save mechanism
- Dynamic configuration
- Multi-language support (English/Chinese)
评论 0
登录后参与评分
还没有评论,来抢沙发吧