English | 中文
一个功能丰富的 Minecraft 红包插件,支持多种红包类型和经济系统集成。本项目基于原版进行二次开发和优化。
RedPacket 是一个为 Minecraft 服务器设计的红包系统插件,玩家可以发送和领取虚拟红包,增加服务器的互动性和趣味性。
-
🧧 多种红包类型
- 普通红包:随机金额分配
- 接龙红包:成语接龙玩法
- 口令红包:需要密码才能领取
-
💰 经济系统集成
- 支持 Vault 经济系统
- 支持 PlayerPoints 点券系统
- 灵活的货币类型选择
-
🗄️ 数据库支持
- SQLite(本地数据库)
- MySQL(远程数据库)
- 自动数据持久化
-
🎮 用户友好
- GUI 菜单界面
- 聊天交互式创建
- 会话管理系统
- 颜色代码支持
-
⚙️ 高度可配置
- 红包金额限制
- 数量限制
- 过期时间设置
- 数据库配置
- 发送者设置总金额和红包数量
- 系统随机分配每个红包的金额
- 先到先得,抢完为止
- 基于成语接龙的互动红包
- 玩家需要正确接龙才能领取
- 增加游戏趣味性和挑战性
- 需要输入正确口令才能领取
- 适合特定群体或活动使用
- 增加红包的专属性
- 服务器: Spigot/Paper 1.12.2 - 1.20+
- Java: Java 8 或更高版本
- 依赖插件(可选):
- Vault(经济系统支持)
- PlayerPoints(点券系统支持)
-
下载插件
# 从 Releases 下载最新版本的 JAR 文件 # 或使用 Maven 编译 mvn clean package
-
安装插件
# 将 JAR 文件复制到服务器 plugins 目录 cp target/RedPacket-3.5.0.jar /path/to/server/plugins/ -
安装依赖(可选)
- 下载并安装 Vault 插件
- 下载并安装 PlayerPoints 插件
- 安装任意经济插件(如 EssentialsX)
-
启动服务器
- 首次启动会自动生成配置文件
- 配置文件位于
plugins/RedPacket/config.yml
-
配置插件
- 编辑
config.yml配置数据库和红包设置 - 重载插件:
/rp reload
- 编辑
Database:
# 数据库类型:sqlite 或 mysql
Type: sqlite
# SQLite 配置
FileName: database.db
# MySQL 配置(使用 MySQL 时需要配置)
IP: localhost
Port: 3306
UserName: root
Password: password
DatabaseName: minecraft
MySQLArgument: "?useUnicode=true&characterEncoding=utf8"
# 数据表名称
TableName: redpacketRedPacket:
# 单个红包最大数量
MaxAmount: 10000
# 红包最大总额
MaxMoney: 10000
# 红包最小总额
MinMoney: 1
# 是否自动过期
Expired: false
# 过期时间(毫秒)
ExpiredTime: 4800000 # 80分钟# 主命令(别名:/fhb, /rp)
/redpacket [new|get|help]
# 创建红包
/rp new
# 领取红包
/rp get <红包ID>
# 查看帮助
/rp help
# 重载配置(管理员)
/rp reload-
输入命令
/rp new
-
选择红包类型
- 在聊天中输入数字选择类型
- 1: 普通红包
- 2: 接龙红包
- 3: 口令红包
-
设置参数
- 输入总金额
- 输入红包数量
- 输入祝福语(可选)
- 口令红包需要设置口令
-
确认发送
- 系统扣除相应金额
- 生成红包ID
- 在聊天中显示红包信息
# 点击聊天中的红包链接
# 或使用命令
/rp get <红包ID>
# 口令红包需要输入口令
/rp get <红包ID> <口令># 用户权限(默认所有玩家)
redpacket.user: true
# 管理员权限(默认OP)
redpacket.admin: true# 命令权限
redpacket.command.new: true # 创建红包
redpacket.command.get: true # 领取红包
redpacket.command.session: true # 会话管理
redpacket.command.reload: op # 重载配置
# 红包类型权限
redpacket.set.commonredpacket: true # 发送普通红包
redpacket.set.jielongredpacket: true # 发送接龙红包
redpacket.set.passwordredpacket: true # 发送口令红包
redpacket.get.commonredpacket: true # 领取普通红包
redpacket.get.jielongredpacket: true # 领取接龙红包
redpacket.get.passwordredpacket: true # 领取口令红包
# 特殊权限
redpacket.chat.color: op # 聊天颜色代码RedPacket-master/
├── src/main/java/sandtechnology/redpacket/
│ ├── RedPacketPlugin.java # 主插件类
│ ├── command/
│ │ └── CommandHandler.java # 命令处理器
│ ├── database/
│ │ ├── AbstractDatabaseManager.java # 数据库抽象类
│ │ ├── MysqlManager.java # MySQL 管理器
│ │ └── SqliteManager.java # SQLite 管理器
│ ├── listener/
│ │ ├── ChatListener.java # 聊天监听器
│ │ └── MessageSender.java # 消息发送器
│ ├── redpacket/
│ │ └── RedPacket.java # 红包核心类
│ ├── session/
│ │ ├── CreateSession.java # 创建会话
│ │ ├── QuerySession.java # 查询会话
│ │ └── SessionManager.java # 会话管理器
│ ├── ui/
│ │ ├── GuiMenu.java # GUI 菜单
│ │ └── MenuListener.java # 菜单监听器
│ └── util/
│ ├── ColorHelper.java # 颜色工具
│ ├── CommonHelper.java # 通用工具
│ ├── CompatibilityHelper.java # 兼容性工具
│ ├── EcoAndPermissionHelper.java # 经济权限工具
│ ├── IdiomManager.java # 成语管理器
│ ├── JsonHelper.java # JSON 工具
│ ├── MessageHelper.java # 消息工具
│ ├── OperatorHelper.java # 操作工具
│ └── RedPacketManager.java # 红包管理器
│
├── src/main/resources/
│ ├── config.yml # 配置文件
│ ├── plugin.yml # 插件元数据
│ ├── idiom.json # 成语数据
│ └── LICENSE-* # 许可证文件
│
├── pom.xml # Maven 配置
├── LICENSE # 项目许可证
└── README.md # 项目说明
# 克隆项目
git clone https://github.com/xiaoxin-zk/RedPacket.git
cd RedPacket
# 使用 Maven 编译
mvn clean package
# 编译后的文件位于
# target/RedPacket-3.5.0.jar- Spigot API 1.19.3 - Minecraft 服务器 API
- Vault API 1.7 - 经济系统接口
- PlayerPoints 3.2.5 - 点券系统
- MySQL Connector 8.0.30 - MySQL 数据库驱动
- SQLite JDBC 3.40.0.0 - SQLite 数据库驱动
- Java 8
- Maven 构建工具
- Spigot/Bukkit API
- JDBC 数据库连接
- JSON 数据处理
- 内置成语数据库(idiom.json)
- 智能匹配算法
- 支持多音字处理
- 防作弊机制
- 交互式创建流程
- 状态机管理
- 超时自动取消
- 错误处理和提示
- 可视化操作界面
- 物品图标展示
- 点击交互
- 动态更新
CREATE TABLE redpacket (
id VARCHAR(36) PRIMARY KEY, -- 红包ID
type VARCHAR(20), -- 红包类型
creator VARCHAR(36), -- 创建者UUID
total_amount DECIMAL(10,2), -- 总金额
count INT, -- 红包数量
remaining INT, -- 剩余数量
message TEXT, -- 祝福语
password VARCHAR(50), -- 口令(口令红包)
create_time BIGINT, -- 创建时间
expire_time BIGINT, -- 过期时间
currency_type VARCHAR(20), -- 货币类型
data TEXT -- 额外数据(JSON)
);欢迎提交 Issue 和 Pull Request!
- Fork 本项目
- 创建特性分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启 Pull Request
本项目基于原项目进行二次开发。
部分代码来自:https://github.com/SeraphJACK/JieLong
- 原作者:sandtechnology
- JieLong 项目:SeraphJACK
- Spigot 社区
- 所有贡献者
如有问题或建议,请通过以下方式联系:
- 提交 GitHub Issue
- 在服务器论坛发帖
本插件仅供学习和娱乐使用,请勿用于商业用途。使用本插件造成的任何问题,开发者不承担责任。
版本: 3.5.0 API 版本: 1.20 最后更新: 2024
注意: 这是一个二次开发版本,在原版基础上进行了优化和改进。
中文 | English
A feature-rich Minecraft red packet plugin supporting multiple packet types and economy system integration. This project is a modified version based on the original.
RedPacket is a red packet system plugin designed for Minecraft servers, allowing players to send and receive virtual red packets, enhancing server interactivity and fun.
-
🧧 Multiple Packet Types
- Common Red Packet: Random amount distribution
- JieLong Red Packet: Chinese idiom chain game
- Password Red Packet: Requires password to claim
-
💰 Economy System Integration
- Vault economy system support
- PlayerPoints points system support
- Flexible currency type selection
-
🗄️ Database Support
- SQLite (local database)
- MySQL (remote database)
- Automatic data persistence
-
🎮 User Friendly
- GUI menu interface
- Chat interactive creation
- Session management system
- Color code support
-
⚙️ Highly Configurable
- Red packet amount limits
- Quantity limits
- Expiration time settings
- Database configuration
- Sender sets total amount and packet count
- System randomly distributes amount for each packet
- First come first served
- Interactive red packet based on Chinese idiom chain
- Players need to correctly continue the idiom chain to claim
- Increases game fun and challenge
- Requires correct password to claim
- Suitable for specific groups or events
- Adds exclusivity to red packets
- Server: Spigot/Paper 1.12.2 - 1.20+
- Java: Java 8 or higher
- Dependencies (optional):
- Vault (economy system support)
- PlayerPoints (points system support)
-
Download Plugin
# Download latest JAR from Releases # Or compile with Maven mvn clean package
-
Install Plugin
# Copy JAR file to server plugins directory cp target/RedPacket-3.5.0.jar /path/to/server/plugins/ -
Install Dependencies (optional)
- Download and install Vault plugin
- Download and install PlayerPoints plugin
- Install any economy plugin (e.g., EssentialsX)
-
Start Server
- Configuration file will be auto-generated on first start
- Config file located at
plugins/RedPacket/config.yml
-
Configure Plugin
- Edit
config.ymlto configure database and red packet settings - Reload plugin:
/rp reload
- Edit
Database:
# Database type: sqlite or mysql
Type: sqlite
# SQLite configuration
FileName: database.db
# MySQL configuration (required when using MySQL)
IP: localhost
Port: 3306
UserName: root
Password: password
DatabaseName: minecraft
MySQLArgument: "?useUnicode=true&characterEncoding=utf8"
# Table name
TableName: redpacketRedPacket:
# Maximum packet count
MaxAmount: 10000
# Maximum total amount
MaxMoney: 10000
# Minimum total amount
MinMoney: 1
# Auto expiration
Expired: false
# Expiration time (milliseconds)
ExpiredTime: 4800000 # 80 minutes# Main command (aliases: /fhb, /rp)
/redpacket [new|get|help]
# Create red packet
/rp new
# Claim red packet
/rp get <packet_id>
# View help
/rp help
# Reload config (admin)
/rp reload-
Enter Command
/rp new
-
Select Packet Type
- Enter number in chat to select type
- 1: Common red packet
- 2: JieLong red packet
- 3: Password red packet
-
Set Parameters
- Enter total amount
- Enter packet count
- Enter blessing message (optional)
- Password red packet requires password
-
Confirm Send
- System deducts corresponding amount
- Generates packet ID
- Displays packet info in chat
# Click red packet link in chat
# Or use command
/rp get <packet_id>
# Password red packet requires password
/rp get <packet_id> <password># User permission (default all players)
redpacket.user: true
# Admin permission (default OP)
redpacket.admin: true# Command permissions
redpacket.command.new: true # Create red packet
redpacket.command.get: true # Claim red packet
redpacket.command.session: true # Session management
redpacket.command.reload: op # Reload config
# Packet type permissions
redpacket.set.commonredpacket: true # Send common red packet
redpacket.set.jielongredpacket: true # Send JieLong red packet
redpacket.set.passwordredpacket: true # Send password red packet
redpacket.get.commonredpacket: true # Claim common red packet
redpacket.get.jielongredpacket: true # Claim JieLong red packet
redpacket.get.passwordredpacket: true # Claim password red packet
# Special permissions
redpacket.chat.color: op # Chat color codes# Clone project
git clone https://github.com/xiaoxin-zk/RedPacket.git
cd RedPacket
# Build with Maven
mvn clean package
# Compiled file located at
# target/RedPacket-3.5.0.jar- Spigot API 1.19.3 - Minecraft server API
- Vault API 1.7 - Economy system interface
- PlayerPoints 3.2.5 - Points system
- MySQL Connector 8.0.30 - MySQL database driver
- SQLite JDBC 3.40.0.0 - SQLite database driver
- Java 8
- Maven build tool
- Spigot/Bukkit API
- JDBC database connection
- JSON data processing
Issues and Pull Requests are welcome!
- Fork this project
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is a modified version based on the original project.
Part of the code is from: https://github.com/SeraphJACK/JieLong
- Original author: sandtechnology
- JieLong project: SeraphJACK
- Spigot community
- All contributors
For questions or suggestions, please contact via:
- Submit GitHub Issue
- Post on server forums
This plugin is for learning and entertainment purposes only. Do not use for commercial purposes. The developer is not responsible for any issues caused by using this plugin.
Version: 3.5.0 API Version: 1.20 Last Updated: 2024
Note: This is a modified version with optimizations and improvements based on the original.