SyVote
一款功能强大的 Minecraft 1.21.x 投票插件,支持 Purpur / Paper,并集成 Vault 经济系统。
功能特性
- 玩家发起投票 — 普通玩家可以自行发起全服范围的投票
- Vault 经济集成 — 创建投票时可配置费用,自动从玩家余额中扣除
- 管理员可控设置 — 管理员可以自由切换玩家创建投票的权限并调整费用
- 全服广播 — 支持向所有玩家广播可点击的投票链接
- 实时投票结果 — 投票结束时自动公布赞成/反对的数量及百分比
- 超链接投票 — 玩家只需点击聊天中的超链接即可快速参与投票
- 并发投票 — 支持多个投票同时进行,并可配置每个玩家同时拥有的最大活跃投票数
- 细粒度权限控制 — 提供精细的权限节点,灵活控制每位玩家的操作权限
依赖要求
| 项目 |
版本 |
| Minecraft Server |
1.21.x |
| 服务器类型 |
Purpur / Paper |
| Java |
21+ |
| Vault (可选) |
任意版本 |
安装步骤
- 下载
SyVote-1.0.0.jar
- 将 jar 文件放入服务器的
plugins/ 目录
- 确保已安装 Vault 和经济类插件(例如 EssentialsX)
- 重启服务器或运行
/reload confirm
- 编辑
plugins/SyVote/config.yml 以自定义配置
命令列表
玩家命令
| 命令 |
描述 |
权限 |
/syvote create <title> <description> [duration] |
创建新投票 |
syvote.create |
/syvote vote <voteId> [yes/no] |
对指定投票进行投票 |
syvote.use |
/syvote list |
列出所有活跃投票 |
syvote.use |
/syvote info <voteId> |
查看投票详细信息 |
syvote.use |
/syvote help |
显示帮助信息 |
syvote.use |
管理员命令
| 命令 |
描述 |
权限 |
/syvote cancel <voteId> |
强制取消指定投票 |
syvote.admin |
/syvote broadcast <voteId> |
向全服发送投票通知(含可点击链接) |
syvote.admin |
/syvote setcost <amount> |
设置玩家创建投票所需支付的费用 |
syvote.admin |
/syvote togglecreate |
启用/禁用玩家创建投票功能 |
syvote.admin |
/syvote reload |
重新加载配置文件 |
syvote.admin |
所有命令也可使用别名 /sv 或 /vote 调用。
权限节点
| 权限 |
默认值 |
描述 |
syvote.use |
所有玩家 |
使用基本投票功能 |
syvote.create |
所有玩家 |
创建投票(受配置开关限制) |
syvote.admin |
OP |
管理员权限,包含所有子权限 |
配置文件
# 是否允许玩家自行创建投票
allow-player-create: true
# 创建投票的费用(需要安装 Vault 经济插件)
create-cost: 100.0
# 默认投票持续时间(分钟)
default-duration: 10
# 每个玩家同时拥有的最大活跃投票数
max-active-votes: 3
# 是否允许玩家对自己创建的投票进行投票
allow-self-vote: false
# 消息前缀
prefix: "&b[SyVote] &r"
# 消息内容(支持颜色代码)
messages:
no-permission: "&c你没有执行此操作的权限!"
no-vault: "&c未安装 Vault 经济插件;经济功能不可用!"
insufficient-funds: "&c你的余额不足;你需要 &e%cost% &e金币!"
vote-created: "&a投票创建成功!费用:&e%cost% &a金币。"
vote-ended: "&e投票 &6%title% &e已结束!"
vote-cancelled: "&c投票 &6%title% &c已被取消!"
already-voted: "&c你已经投过票了!"
self-vote-denied: "&c你不能对自己创建的投票进行投票!"
vote-not-found: "&c未找到该投票!"
no-active-votes: "&c当前没有活跃的投票。"
max-votes-reached: "&c你已有的活跃投票数量已达上限!"
player-create-disabled: "&c管理员已禁用玩家创建投票功能!"
broadcast-message: "&6[投票] &e%creator% &f发起了一项投票:&6%title%"
broadcast-hover: "&a点击投票!"
vote-success: "&a投票成功!"
vote-results: "&6===== 投票结果:%title% ====="
vote-result-yes: "&a赞成:%yes% (&f%yesPercent%%&a)"
vote-result-no: "&c反对:%no% (&f%noPercent%%&c)"
vote-result-total: "&e总票数:%total%"
config-reloaded: "&a配置已重新加载!"
create-cost-set: "&a投票创建费用已设置为 &e%cost%"
player-create-enabled: "&a玩家创建投票功能已启用!"
player-create-disabled-msg: "&c玩家创建投票功能已禁用!"
使用示例
创建投票(玩家)
/syvote create "是否开启PVP?" "我们是否应该在出生地区域开启PVP功能?"
创建后,将向全服发送一条可点击的广播消息:
[投票] Shiyuan 发起了一项投票:是否开启PVP? (点击投票)
进行投票
点击聊天中的投票链接,或手动输入命令:
/syvote vote vote_1_xxx yes # 投赞成票
/syvote vote vote_1_xxx no # 投反对票
管理员广播
/syvote broadcast vote_1_xxx
重新向全服发送指定投票的可点击链接,方便提醒玩家参与。
设置创建费用
/syvote setcost 500
将玩家创建投票的费用设置为 500 金币。
禁用玩家创建投票
/syvote togglecreate
禁用后,只有拥有 syvote.admin 权限的管理员才能创建投票。
项目结构
SyVote/
├── pom.xml # Maven 构建配置
├── README.md # 项目文档
└── src/
└── main/
├── resources/
│ ├── plugin.yml # 插件描述文件
│ └── config.yml # 默认配置文件
└── java/cn/shiyuan/syvote/
├── SyVote.java # 主类
├── model/
│ └── Vote.java # 投票数据模型
├── manager/
│ ├── ConfigManager.java # 配置管理器
│ ├── EconomyManager.java # Vault 经济管理器
│ ├── MessageManager.java # 消息管理器
│ └── VoteManager.java # 投票逻辑管理器
└── command/
└── VoteCommand.java # 命令处理器
构建
# 克隆仓库
git clone <repository-url>
cd SyVote
# 使用 Maven 进行构建
mvn clean package
# 构建完成后,jar 包位于 target/SyVote-1.0.0.jar
SyVote
A powerful Minecraft 1.21.x voting plugin, supporting Purpur / Paper, integrated with the Vault economy system.
Features
- Player-Initiated Votes — Regular players can launch server-wide votes on their own
- Vault Economy Integration — Votes can be created with a configurable fee, automatically deducted from the player's balance
- Admin-Configurable Controls — Administrators can freely toggle the player vote-creation permission and adjust the fee
- Server-Wide Broadcasts — Support for broadcasting clickable vote links to all players
- Real-Time Vote Results — Automatically publishes yes/no vote counts and percentages when a vote ends
- Hyperlink-Based Voting — Players can quickly participate by clicking the hyperlink in chat
- Concurrent Votes — Multiple votes can run simultaneously, with a configurable maximum number of active votes per player
- Granular Permissions — Fine-grained permission nodes to flexibly control what each player can do
Requirements
| Item |
Version |
| Minecraft Server |
1.21.x |
| Server Type |
Purpur / Paper |
| Java |
21+ |
| Vault (Optional) |
Any version |
Installation
- Download
SyVote-1.0.0.jar
- Place the jar file into the server's
plugins/ directory
- Make sure Vault and an economy plugin (e.g. EssentialsX) are installed
- Restart the server or run
/reload confirm
- Edit
plugins/SyVote/config.yml to customize the configuration
Commands
Player Commands
| Command |
Description |
Permission |
/syvote create <title> <description> [duration] |
Create a new vote |
syvote.create |
/syvote vote <voteId> [yes/no] |
Cast a vote on a specified vote |
syvote.use |
/syvote list |
List all active votes |
syvote.use |
/syvote info <voteId> |
View detailed information of a vote |
syvote.use |
/syvote help |
Show the help message |
syvote.use |
Admin Commands
| Command |
Description |
Permission |
/syvote cancel <voteId> |
Forcefully cancel a specified vote |
syvote.admin |
/syvote broadcast <voteId> |
Send a vote notification (with a clickable link) to the entire server |
syvote.admin |
/syvote setcost <amount> |
Set the fee players must pay to create a vote |
syvote.admin |
/syvote togglecreate |
Enable/disable the player vote-creation feature |
syvote.admin |
/syvote reload |
Reload the configuration file |
syvote.admin |
All commands can also be invoked with the aliases /sv or /vote.
Permission Nodes
| Permission |
Default |
Description |
syvote.use |
All players |
Use basic voting features |
syvote.create |
All players |
Create votes (subject to the configuration toggle) |
syvote.admin |
OP |
Administrator permission, includes all sub-permissions |
Configuration File
# Whether to allow players to create votes on their own
allow-player-create: true
# Fee for creating a vote (requires the Vault economy plugin)
create-cost: 100.0
# Default vote duration (in minutes)
default-duration: 10
# Maximum number of concurrent active votes per player
max-active-votes: 3
# Whether to allow players to vote on votes they created
allow-self-vote: false
# Message prefix
prefix: "&b[SyVote] &r"
# Messages (color codes are supported)
messages:
no-permission: "&cYou do not have permission to perform this action!"
no-vault: "&cVault economy plugin is not installed; economy features are unavailable!"
insufficient-funds: "&cYou don't have enough balance; you need &e%cost% &cgold!"
vote-created: "&aVote created successfully! Cost: &e%cost% &agold."
vote-ended: "&eVote &6%title% &ehas ended!"
vote-cancelled: "&cVote &6%title% &chas been cancelled!"
already-voted: "&cYou have already voted!"
self-vote-denied: "&cYou cannot vote on a vote you created!"
vote-not-found: "&cVote not found!"
no-active-votes: "&cThere are no active votes at the moment."
max-votes-reached: "&cYou already have too many active votes!"
player-create-disabled: "&cThe administrator has disabled the player vote-creation feature!"
broadcast-message: "&6[Vote] &e%creator% &fstarted a vote: &6%title%"
broadcast-hover: "&aClick to vote!"
vote-success: "&aVote cast successfully!"
vote-results: "&6===== Vote Results: %title% ====="
vote-result-yes: "&aYes: %yes% (&f%yesPercent%%&a)"
vote-result-no: "&cNo: %no% (&f%noPercent%%&c)"
vote-result-total: "&eTotal votes: %total%"
config-reloaded: "&aConfiguration reloaded!"
create-cost-set: "&aVote creation cost has been set to &e%cost%"
player-create-enabled: "&aPlayer vote-creation feature has been enabled!"
player-create-disabled-msg: "&cPlayer vote-creation feature has been disabled!"
Usage Examples
Create a Vote (Player)
/syvote create "Enable PVP?" "Should we enable the PVP feature in the spawn area?"
After creation, a clickable broadcast message will be sent to the entire server:
[Vote] Shiyuan started a vote: Enable PVP? (click to vote)
Cast a Vote
Click the vote link in chat, or type the command manually:
/syvote vote vote_1_xxx yes # Vote yes
/syvote vote vote_1_xxx no # Vote no
Admin Broadcast
/syvote broadcast vote_1_xxx
Resends a clickable link of the specified vote to the entire server, making it easier to remind players to participate.
Set the Creation Fee
/syvote setcost 500
Sets the cost for players to create a vote to 500 gold.
Disable Player Vote Creation
/syvote togglecreate
After disabling, only administrators with the syvote.admin permission can create votes.
Project Structure
SyVote/
├── pom.xml # Maven build configuration
├── README.md # Project documentation
└── src/
└── main/
├── resources/
│ ├── plugin.yml # Plugin descriptor
│ └── config.yml # Default configuration file
└── java/cn/shiyuan/syvote/
├── SyVote.java # Main class
├── model/
│ └── Vote.java # Vote data model
├── manager/
│ ├── ConfigManager.java # Configuration manager
│ ├── EconomyManager.java # Vault economy manager
│ ├── MessageManager.java # Message manager
│ └── VoteManager.java # Vote logic manager
└── command/
└── VoteCommand.java # Command handler
Building
# Clone the repository
git clone <repository-url>
cd SyVote
# Build with Maven
mvn clean package
# After the build completes, the jar is located at target/SyVote-1.0.0.jar
评论 0
登录后参与评分
还没有评论,来抢沙发吧