RedPacket - Minecraft Lucky Red Packet Plugin
A lucky red packet plugin for Paper 1.20.x - 1.21.x servers, built on the Vault economy system.
One plugin version supports all compatible servers!
Supported Server Versions
- ✅ Paper 1.20.1 (API 1.20+)
- ✅ Paper 1.20.4 (API 1.20+)
- ✅ Paper 1.20.6 (API 1.20+)
- ✅ Paper 1.21 (API 1.20+)
- ✅ Paper 1.21.1 (API 1.20+)
- ✅ Paper 1.21.11 (API 1.20+)
Features
- Red Packet Creation
- Players can create red packets via commands
- Customizable quantity, total amount, and duration (max 10 minutes)
- Automatic balance verification and deduction
- Red Packet Grabbing
- Random amount allocation (lucky grab style)
- Anti-duplicate grabbing mechanism
- Real-time balance credit to player's account
- Red Packet Management
- Only one active red packet at a time
- Automatic expiration handling (auto-settle when expired)
- Unclaimed amounts automatically returned to creator
- Status Query
- View current red packet status
- Display remaining quantity, amount, and time
- Data Persistence
- Auto-restore unsettled red packets after server restart
- Complete logging
- Admin Commands
- Force end and settle current red packet
- Language switching (Simplified Chinese/English)
- Detailed statistics and logging
- Multi-language Support
- Supports Simplified Chinese and English
- Switchable via config file or commands
- Graceful fallback for missing translations
- Multi-version Compatibility
- Compiled with Paper API 1.20
- Single plugin version supports all 1.20.x - 1.21.x versions
- No need to compile different plugins for different versions
Commands
Command
Description
Code (Text):
/redpacket create <quantity> <amount> <duration(minutes)> Create a red packet
/redpacket grab Grab the red packet
/redpacket status View red packet status
/redpacket end Force end current red packet (Admin)
/redpacket lang <language_code> Switch language (Admin)
/redpacket help Show help message
Aliases: /rp, /redpack
Permissions
Permission
Description
Default
redpacket.use Use red packet features All players
redpacket.admin Administrator permissions OP
Language Codes
Code
Language
zh_CN 简体中文
en_US English
Requirements
- Paper 1.20.1 or higher (API 1.20+)
- Vault plugin
- Any Vault-compatible economy plugin (e.g., EssentialsX, CMI)
Build
Build with Maven:
Code (Text):
mvn clean package
The compiled jar will be in the target/ directory.
Configuration
Config files will be generated in plugins/RedPacket/ after plugin startup:
Code (Text):
# config.yml
language: en_US # Default language: zh_CN or en_US
max_duration_minutes: 10 # Maximum red packet duration (minutes)
Multi-version Compatibility
This plugin is compiled with
Paper API 1.20, leveraging Paper's backward compatibility:
- API Version Declaration: Declare api-version: 1.20 in plugin.yml
- Backward Compatibility: Paper servers automatically compatible with plugins compiled with lower API versions
- Common API Usage: Plugin only uses common APIs supported by all versions, no version-specific features
This means the same plugin jar can run on:
- Paper 1.20.x series servers
- Paper 1.21.x series servers
- Any future Paper version compatible with API 1.20+
License
This project is licensed under the MIT License.
RedPacket - Minecraft 拼手气红包插件
适用于 Paper 1.20.x - 1.21.x 的拼手气红包插件,基于 Vault 经济系统实现。
一个插件版本即可支持所有兼容服务器!
支持的服务器版本
- ✅ Paper 1.20.1 (API 1.20+)
- ✅ Paper 1.20.4 (API 1.20+)
- ✅ Paper 1.20.6 (API 1.20+)
- ✅ Paper 1.21 (API 1.20+)
- ✅ Paper 1.21.1 (API 1.20+)
- ✅ Paper 1.21.11 (API 1.20+)
功能特性
- 红包创建
- 玩家可通过指令创建红包
- 支持自定义份数、总金额和持续时间(最长10分钟)
- 自动验证余额并扣除
- 红包抢夺
- 拼手气随机分配金额
- 防重复抢夺机制
- 抢到的金额实时存入玩家账户
- 红包管理
- 同一时间只能存在一个进行中的红包
- 自动过期处理(到期自动结算)
- 未领取金额自动返还给创建者
- 状态查询
- 数据持久化
- 管理员命令
- 可强制结束并结算当前红包
- 支持语言切换(简体中文/英文)
- 详细的统计信息和日志记录
- 多语言支持
- 支持简体中文和英文
- 可通过配置文件或命令切换语言
- 缺失文本自动降级处理
- 多版本兼容
- 基于 Paper API 1.20 编译
- 单个插件版本支持所有 1.20.x - 1.21.x 版本
- 无需为不同版本编译不同插件
指令
指令
描述
Code (Text):
/redpacket create <份数> <总金额> <持续时间(分钟)> 创建红包
/redpacket grab 抢红包
/redpacket status 查看红包状态
/redpacket end 强制结束当前红包(管理员)
/redpacket lang <语言代码> 切换语言(管理员)
/redpacket help 显示帮助信息
别名:/rp, /redpack
权限
权限
描述
默认
Code (Text):
redpacket.use 使用红包功能 所有玩家
redpacket.admin 管理员权限 OP
语言代码
代码
语言
zh_CN 简体中文
en_US English
依赖
- Paper 1.20.1 或更高版本(API 1.20+)
- Vault 插件
- 任何 Vault 兼容的经济插件(如 EssentialsX、CMI)
编译
使用 Maven 编译:
Code (Text):
mvn clean package
编译后的 jar 文件位于 target/ 目录中。
配置
插件启动后会在 plugins/RedPacket/ 目录下生成配置文件:
Code (Text):
# config.yml
language: zh_CN # 默认语言: zh_CN 或 en_US
max_duration_minutes: 10 # 红包最长持续时间(分钟)
多版本兼容原理
本插件基于
Paper API 1.20 进行编译,利用 Paper 的向后兼容性特性:
- API 版本声明:plugin.yml 中声明 api-version: 1.20
- 向后兼容设计:Paper 服务器会自动兼容使用较低 API 版本编译的插件
- 通用 API 使用:插件只使用所有版本都支持的通用 API,不依赖特定版本的新功能
这意味着同一个插件 jar 文件可以在:
- Paper 1.20.x 系列服务器
- Paper 1.21.x 系列服务器
- 任何未来兼容 API 1.20+ 的 Paper 版本
许可证
本项目采用 MIT 许可证。