VitalVials 插件
VitalVials 是一款独特的 Minecraft 插件,允许玩家使用生命值购买和管理游戏内效果。通过完全可自定义的配置,服务器管理员可以在风险与回报之间取得平衡,玩家必须仔细权衡强大效果的代价与其自身生命力之间的关系。
功能特性
- 基于生命值的经济系统:玩家消耗最大生命值/生命值点数以换取强大的效果
- 完全可配置:自定义每个效果的各个方面、成本和机制
- 动态计分板:实时追踪当前生效的效果及其剩余持续时间
- 玩家专属设置:每位玩家均可自定义自己的计分板显示
- 冷却系统:通过可配置的冷却时间防止效果滥用
- 退款系统:支持退还已购买的效果(可按单个效果单独配置)
安装步骤
- 从 发布页面 下载最新版本的 VitalVials
- 将
VitalVials.jar 文件放入服务器的 plugins/ 目录中
- 重启服务器
- 在
plugins/VitalVials/config.yml、plugins/VitalVials/effects.yml 和 plugins/VitalVials/activation.yml 中按喜好配置插件
- 使用
/vv reload 命令应用更改,无需重启服务器
指令
主指令
/vv 或 /vitalvials - VitalVials 的主指令
子指令
/vv reload - 重载插件配置
/vv shop - 打开效果商店
/vv buyEffect <effect> - 直接购买指定效果
/vv viewStatus - 查看你当前激活的效果状态
/vv scoreboard <on/off/editShort> - 开启、关闭或自定义你的计分板
/vv refundEffect <effect> - 退还指定效果
/vv removeData <player/allPlayer> - 删除玩家数据
权限说明
| 权限名称 |
描述 |
默认值 |
vv.admin |
拥有所有指令的完整访问权限 |
op |
vv.reload |
允许重载插件配置 |
op |
vv.shop |
访问效果商店 |
op |
vv.buyEffect |
允许购买效果 |
op |
vv.viewstatus |
查看自身效果状态 |
op |
vv.scoreboard |
访问计分板自定义功能 |
op |
vv.refundEffect |
退还已购买的效果 |
op |
vv.removedata |
删除玩家数据 |
op |
配置说明
VitalVials 高度可配置,主要通过 config.yml、effects.yml 和 activation.yml 三个文件进行设置。以下是主要配置部分:
主配置文件
点击展开
配置文件(config.yml)允许你自定义插件的多个方面:
effects: effects.yml # 包含效果列表的 effects.yml 文件路径
activation: activation.yml # 激活设置
maxHP: # 最大生命值上限
enabled: true # 启用/禁用最大生命值上限。启用后,玩家在尝试退还效果时无法获得额外生命值,因此玩家的生命值不会超过你设定的上限
value: 20 # 最大生命值(生命点数)
minHP: 2 # 最低生命值限制:当玩家生命值等于或低于此数值时,将不允许购买效果
scoreboard: # 记分板设置
defaultShowScoreboard: true # 默认在右侧显示记分板(如果授予权限,每个玩家可以自行使用命令关闭)
periodUpdate: 10 # 更新记分板的间隔时间(以秒为单位)
permissionsAllPlayer:
reload: false # 允许所有玩家使用重载命令
shop: true # 允许所有玩家使用商店命令
buyEffect: true # 允许所有玩家使用购买效果命令
viewStatus: true # 允许所有玩家使用查看状态命令
scoreboard: true # 允许所有玩家使用记分板命令
refundEffect: true # 允许所有玩家使用退还效果命令
removeData: false # 允许所有玩家使用删除数据命令
效果配置
每个效果都可以通过以下选项进行配置:
-
enabled:启用/禁用该效果
-
name:商店中显示的效果名称
-
effect:要赋予的效果名称(默认),如果不确定其含义,请勿更改
-
lore:商店中显示的效果描述信息
-
maxLevel:效果的最大等级/增幅器级别
-
particles:是否在获得效果时显示粒子特效
-
saveEffectData:是否将效果数据保存到玩家数据中
-
priceType: 购买效果时使用的价格类型(使用玩家最大生命值购买选择 MAX_HEALTH,使用当前生命值购买选择 HEALTH)
-
refundPercentage: 购买效果后可退还的生命值百分比(基于 1 级效果计算,设置为 -1 可禁用退款功能)
-
autoActivate: 购买后是否自动激活该效果;若为 false,则需在激活配置中手动设置
数组部分([<等级 1>, <等级 2>, 等]):
-
durationPerUpgrade: 每次升级的持续时间(秒),-1 表示无限(以秒为单位)
-
cooldownPerUpgrade: 每次升级的冷却时间(秒)
-
costPerUpgrade: 每次升级激活所需的生命值消耗(生命值点数)
激活配置
每个物品都可以使用以下选项进行配置:
rightClick: 右键点击你配置的物品时,对你自己生效的效果
leftClick: 左键点击你配置的物品时,对你自己生效的效果
YouAreHittingEnemy: 当你用你配置的物品攻击敌人时,对敌人生效的效果
enemyHitYou: 当敌人用你配置的物品击中你时,对敌人生效的效果
效果自定义
效果在插件文件夹的 effects.yml 中定义。示例:
点击展开
配置文件(effects.yml)允许你自定义插件中的所有效果:
speed: # 效果部分的键,你可以将其更改为你想要的任何内容,你也可以在另一个键上使用相同的效果但具有不同的激活配置
enabled: true # 启用/禁用该效果
name: "§bSpeed" # 效果的名称
effect: "SPEED" # 要赋予的效果名称(默认),如果你不知道它是什么,请不要更改
lore: "Get more speed" # 效果的描述(仅供信息参考)
maxLevel: 2 # 升级效果时的最大增强等级/级别
particles: false # 获取效果时是否启用粒子效果
saveEffectData: true # 将效果数据保存到玩家数据中(如果为“false”,则只有在“autoActivate”为真时才能激活效果,并且只能使用一次,玩家无法对其进行升级)
priceType: MAX_HEALTH # 购买效果时的价格类型(MAX_HEALTH 表示使用玩家的最大生命值购买,HEALTH 表示使用玩家的当前生命值购买)
refundPercentage: 50 # 购买效果后可退还的生命值百分比(基于一级效果计算)(设为 -1 以禁用退款)
autoActivate: true # 自动激活效果;若为 true,则在购买后自动激活该效果
如果为 false,则需要在激活配置中设置它
#=====[数组部分]=====
[<首次升级等级>, <第二次升级等级>, ...]
durationPerUpgrade: [-1, -1] # 每次升级的效果持续时间,-1 表示无限(单位为秒)
cooldownPerUpgrade: [0, 0] # 每次使用效果时的冷却时间(单位为秒)
costPerUpgrade: [10, 18] # 每次升级购买效果时的消耗(生命值)
</details>
## 激活自定义
你可以通过编辑 `activation.yml` 文件来自定义插件中效果的激活方式。
<details>
<summary>点击展开</summary>
配置文件(activation.yml)允许你自定义插件中效果的激活方式:
```yaml
ALL_ITEMS: # 使用所有物品或无物品时激活到你自身的效果
rightClick: [] # 使用所有物品或无物品右键点击时激活到你自身的效果
leftClick: [] # 使用所有物品或无物品左键点击时激活到你自身的效果
YouAreHittingEnemy: [] # 使用所有物品或无物品击中敌人时激活到你自身的效果
enemyHitYou: [poison, wither, darkness] # 被敌人使用所有物品或无物品击中时激活到你自身的效果
SWORD: # 物品名称(所有类型的剑)
rightClick: [resistance] # 使用该物品右键点击时激活到你自身的效果
leftClick: [] # 使用该物品左键点击时激活到你自身的效果
YouAreHittingEnemy: [nausea, weakness, weaving, oozing, infested] # 使用该物品击中敌人时激活到你自身的效果
enemyHitYou: [slowness, mining_fatigue] # 被敌人使用该物品击中时激活到你自身的效果
记分板
记分板可以通过 /vv scoreboard 切换显示,并支持以下自定义选项:
支持
如需支持,请在 GitHub 上提交问题。
许可证
本项目采用 MIT 许可证进行授权 - 详情请参阅 LICENSE 文件。
由 b4n9z 制作
VitalVials Plugin
VitalVials is a unique Minecraft plugin that allows players to purchase and manage in-game effects using their health. With a fully customizable configuration, server owners can create a balanced between risk and reward, where players must carefully consider the cost of powerful effects against their own vitality.
Features
- Health-Based Economy: Players trade their max health / health points for powerful effects
- Fully Configurable: Customize every aspect of effects, costs, and mechanics
- Dynamic Scoreboard: Real-time tracking of active effects and remaining duration
- Player-Specific Settings: Each player can customize their scoreboard
- Cooldown System: Prevent effect spamming with configurable cooldowns
- Refund System: Option to refund effects (configurable per effect)
Installation
- Download the latest version of VitalVials from the releases page
- Place the
VitalVials.jar file in your server's plugins/ directory
- Restart your server
- Configure the plugin to your liking in
plugins/VitalVials/config.yml and plugins/VitalVials/effects.yml and plugins/VitalVials/activation.yml
- Use
/vv reload to apply changes without restarting
Commands
Main Command
/vv or /vitalvials - Main command for VitalVials
Subcommands
/vv reload - Reload the plugin configuration
/vv shop - Opens the effect shop
/vv buyEffect <effect> - Buy an effect directly
/vv viewStatus - View your current active effects
/vv scoreboard <on/off/editShort> - Toggle or customize your scoreboard
/vv refundEffect <effect> - Refund an effect
/vv removeData <player/allPlayer> - Remove player data
Permissions
| Permission |
Description |
Default |
vv.admin |
Full access to all commands |
op |
vv.reload |
Allows reloading the plugin |
op |
vv.shop |
Access to the effect shop |
op |
vv.buyEffect |
Allows buying effects |
op |
vv.viewstatus |
View own effect status |
op |
vv.scoreboard |
Access to scoreboard customization |
op |
vv.refundEffect |
Refund purchased effects |
op |
vv.removedata |
Remove player data |
op |
Configuration
VitalVials is highly configurable through the config.yml, effects.yml and activation.yml file. Here are the main sections:
Main Configuration
Click to expand
The configuration file (config.yml) allows you to customize several aspects of the plugin:
effects: effects.yml # Path to the effects.yml file that contains the effects list
activation: activation.yml # Activation settings
maxHP: # max HP
enabled: true # Enable / Disable max HP, when enabled players can't get more HP when trying to Refund Effect, so player can't get more HP that you set
value: 20 # Max HP (Health Points)
minHP: 2 # Min HP (Health Points) to allow player not buying effect when HP is same or less than this
scoreboard: # scoreboard settings
defaultShowScoreboard: true # Show scoreboard on right side by default (per player can disable it on their own using command if you give them access)
periodUpdate: 10 # period to update scoreboard (in seconds)
permissionsAllPlayer:
reload: false # Allow reload command for all players
shop: true # Allow shop command for all players
buyEffect: true # Allow buyEffect command for all players
viewStatus: true # Allow viewStatus command for all players
scoreboard: true # Allow scoreboard command for all players
refundEffect: true # Allow refundEffect command for all players
removeData: false # Allow removeData command for all players
Effect Configuration
Each effect can be configured with the following options:
enabled: Enable/disable the effect
name: The name of the effect in shop
effect: The name of the effect to give (default), don't change if you don't know what it is
lore: The lore of the effect in shop
maxLevel: The max level/amplifier of the effect
particles: Whether particles will be shown when getting the effect
saveEffectData: Whether the effect data will be saved to the player data
priceType: The type of price when buying the effect (MAX_HEALTH to buy using MAX HEALTH player or HEALTH to buy using HEALTH player)
refundPercentage: The percentage of the HP refundable (calculate from level 1 effect) after buying the effect (-1 to disable refund)
autoActivate: Whether the effect will be auto activated after buying, if false you need set it in activation config
Array section ([<level 1>, <level 2>, etc]):
durationPerUpgrade: Duration in seconds per upgrade, -1 for infinite (in seconds)
cooldownPerUpgrade: Cooldown per upgrade (in seconds)
costPerUpgrade: Health cost to activate per upgrade (Health Points)
Activation Configuration
Each item can be configured with the following options:
rightClick: Effects to activate to your own on right click with the item you configure
leftClick: Effects to activate to your own on left click with the item you configure
YouAreHittingEnemy: Effects to activate to your enemy when you are hitting an enemy with the item you configure
enemyHitYou: Effects to activate to your enemy when an enemy hits you with the item you configure
Effect Customization
Effects are defined in the effects.yml of the plugin folder. Example:
Click to expand
The configuration file (effects.yml) allows you to customize all effects in the plugin:
speed: #key of the effect section, you can change it to anything you want, you can also use same effect to another key with different activation config
enabled: true # enable/disable the effect
name: "§bSpeed" # The name of the effect
effect: "SPEED" # Name of the effect to give (default), don't change if you don't know what it is
lore: "Get more speed" # lore of the effect (Informational only)
maxLevel: 2 # max amplifier/level when upgrading the effect
particles: false # enable/disable particles when getting effect
saveEffectData: true # save effect data to the player data (If “false”, the effect can only be activated when “autoActivate” is true and can only be used once and player can't upgrade it)
priceType: MAX_HEALTH # the type of price when buying the effect (MAX_HEALTH to buy using MAX HEALTH player or HEALTH to buy using HEALTH player)
refundPercentage: 50 # the percentage of the HP refundable (calculate from level 1 effect) after buying the effect (-1 to disable refund)
autoActivate: true # auto activate the effect, if true effect will be auto activated after buying
# if false you need set it in activation config
#=====[array section]=====
# [<first upgrade level>, <second upgrade level>, ...]
durationPerUpgrade: [-1, -1] # duration of the effect per upgrade, -1 for infinite (in seconds)
cooldownPerUpgrade: [0, 0] # cooldown when using the effect per upgrade (in seconds)
costPerUpgrade: [10, 18] # cost when buying the effect per upgrade (Health Points)
Activation Customization
You can customize activation of effects in the plugin by editing the activation.yml file.
Click to expand
The configuration file (activation.yml) allows you to customize activation of effects in the plugin:
ALL_ITEMS: # Effects to activate to your own with all items or no item
rightClick: [] # Effects to activate to your own on right click with all items or no item
leftClick: [] # Effects to activate to your own on left click with all items or no item
YouAreHittingEnemy: [] # Effects to activate when you are hitting an enemy with all items or no item
enemyHitYou: [poison, wither, darkness] # Effects to activate when an enemy hits you with all items or no item
SWORD: # Item name (all type of swords)
rightClick: [resistance] # Effects to activate to your own on right click with the item
leftClick: [] # Effects to activate to your own on left click with the item
YouAreHittingEnemy: [nausea, weakness, weaving, oozing, infested] # Effects to activate when you are hitting an enemy with the item
enemyHitYou: [slowness, mining_fatigue] # Effects to activate when an enemy hits you with the item
Scoreboard
The scoreboard can be toggled with /vv scoreboard and customized with these options:
- Toggle visibility
- Change display order of effects
Support
For support, please open an issue on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Crafted by b4n9z
评论 0
登录后参与评分
还没有评论,来抢沙发吧