WeaponsUltimate
十六种真正具备特殊功能的自定义武器,以及包含 69 种类型的特效库,供你打造专属武器。
这里的“武器”本质上是一个物品、一组触发条件和一个特效列表。击中目标、被击中、击杀敌人、右键点击、潜行并右键点击、射击弓矢、命中投射物——上述每一种行为都可以启动一项能力;而一项能力则是由一系列特效组成的序列,支持设置延迟、概率和重复次数。三跳的闪电链、耗时一秒才落下的陨石、将所有人吸入的黑洞、推开攻击者的护盾穹顶:所有这一切都只需 YAML 配置,无需编写任何代码。
将 jar 包放入服务器即可拥有完整的军火库、对应的合成配方以及军火库 GUI。只需编写十行代码,你就能创造出属于自己的武器。使用 /wu reload 重新加载后即刻生效。

依赖要求
- Bukkit、Spigot、Paper、Purpur 或 Folia,Minecraft 1.21 至 26.3
- Java 17 或更高版本
一个 jar 包通用于以上所有平台。该插件基于原生 Bukkit API 构建,从未调用过 Adventure 库或仅限 Paper 使用的类,因此同一个文件可以在 Spigot 上运行。在服务器启动时会自动检测 Folia,随后所有任务都会分配给负责受影响区块的区域线程或实体线程,这也是为什么在 Folia 上传送、计时器和范围效果的行为保持一致的原因。
测试情况与方法如下:
| Server |
What ran |
| Paper 1.21.1 |
all 16 weapons, every trigger, GUI, recipes |
| Paper 1.21.11 |
all 16 weapons, every trigger, GUI, recipes |
| Folia 1.21.11 |
all 16 weapons, every trigger, GUI, recipes |
| Paper 26.2 |
start, weapon loading, commands, reload, recipes |
前三项由机器人驱动测试,它会装备每种武器,执行击打、右键点击、潜行、射击及打开菜单等操作,并在事后检查控制台日志以确认无错误。在 26.2 上,由于机器人的协议库仅支持到 26.1,它尚无法登录,因此该列仅表示服务器端运行情况(基于对 26.2 API 的编译构建)。
军火库
| Weapon |
Item |
Abilities |
| Voidreaper |
Netherite sword |
Void Mark, Rift Step, Collapse |
| Stormbreaker |
Netherite axe |
Arc Chain, Thunderclap |
| Frostbite |
Diamond sword |
Deep Chill, Glacial Prison |
| Emberlash |
Iron sword |
Searing Cut, Falling Ember, Pyre |
| Gravewalker |
Netherite hoe |
Rot, Soul Harvest, Grave Tribute |
| Tempest |
Bow |
Triple Gale, Burst Arrow |
| Siphon Blade |
Iron sword |
Siphon, Backlash |
| Bulwark |
Shield |
Aegis Dome, Repel |
| Riftpiercer |
Trident |
Seeking Throw, Rift Pull |
| Thunderhoof |
Mace |
Desperate Might, Skyward, Ground Zero |
| Wraithfang |
Iron sword |
Fang Strike, Shadowstep |
| Sunflare |
Crossbow |
Flare Volley, Flashburn |
| Titanbreaker |
Diamond axe |
Sunder, Seismic Slam |
| Serpent's Kiss |
Golden sword |
Venom, Venom Bloom |
| Gale Edge |
Diamond sword |
Tailwind, Gale Dash, Updraft |
| Nullblade |
Netherite sword |
Nullify, Null Field, Cleanse |
每种武器都有独立的合成配方、独立的权限节点,并显示在军火库 GUI 中。
命令
| Command |
Permission |
Description |
/wu |
weaponsultimate.gui |
Opens the arsenal |
/wu give <weapon> [player] [amount] |
weaponsultimate.give |
Hands out a weapon |
/wu list |
weaponsultimate.use |
Lists every loaded weapon |
/wu info <weapon> |
weaponsultimate.use |
Shows item, permission and abilities |
/wu effects |
weaponsultimate.admin |
Lists every available effect type |
/wu reload |
weaponsultimate.reload |
Reloads config, weapons, messages and recipes |
/wu clear-cooldowns [player] |
weaponsultimate.admin |
Clears running cooldowns |
别名:/weaponsultimate, /weapons, /arsenal.
单个武器的访问权限通过 weaponsultimate.weapon.<id> 授予,例如 weaponsultimate.weapon.voidreaper。weaponsultimate.admin 可绕过所有这些限制。
Building a weapon
触发器:attack、attacked、kill、death、right-click、left-click、
sneak-right-click、sneak-left-click、shoot、projectile-hit、hold。
每种效果除了其自身的键之外,还支持 target、radius、angle、max-targets、players-only、delay、
chance、repeat 和 period。所有效果类型及其完整参数列表请参见 EFFECTS.md。
配置
config.yml 包含服务器范围的开关:世界黑白名单、各模组的权限、
合成、铁砧保护、冷却时间和技能名称的反馈渠道、lore
生成器、GUI 布局以及用于快速平衡的全局伤害缩放比例。
messages.yml 包含插件发送的所有字符串,包括生成的 lore 中使用的触发器名称。支持 & 颜色代码和 &#RRGGBB 十六进制颜色。
API
Weapon weapon = WeaponsUltimateApi.weapon("voidreaper");
ItemStack item = WeaponsUltimateApi.item("voidreaper");
Weapon inHand = WeaponsUltimateApi.weaponOf(player.getInventory().getItemInMainHand());
// 自定义效果类型,在下次重载前注册
WeaponsUltimateApi.effects().register("my-effect", section -> {
double power = section.getDouble("power", 1.0);
return context -> context.caster().setVelocity(context.caster().getVelocity().multiply(power));
});
从源码构建
mvn clean package
jar 包位于 target/WeaponsUltimate-<version>.jar。
许可证
GNU General Public License v3.0,详见 LICENSE。
作者
由 LucasTHCR 制作。问题、想法和错误报告:dc.gg/paperstream。
WeaponsUltimate
Sixteen custom weapons that actually do something, and an effect library of 69 types to build your own.
A weapon here is an item, a few triggers and a list of effects. Hit something, get hit, kill
something, right click, sneak and right click, fire a bow, land a projectile - each of those can
start an ability, and an ability is any number of effects in a row, with delays, chances and
repeats. Chain lightning that jumps three times, a meteor that takes a second to land, a black
hole that drags everyone in, a dome that pushes attackers away: all of it is YAML, none of it is
code.
Drop the jar in and you have the full arsenal, its recipes and the arsenal GUI. Write ten lines
and you have your own weapon. Reload with /wu reload and it is live.

Requirements
- Bukkit, Spigot, Paper, Purpur or Folia, Minecraft 1.21 up to 26.3
- Java 17 or newer
One jar for all of them. The plugin is built against the plain Bukkit API and never touches
Adventure or any Paper only class, so the same file runs on Spigot. Folia is detected while the
server boots and every task then goes to the region or entity thread that owns the affected
chunk, which is why teleports, timers and area effects behave the same there.
What was tested, and how:
| Server |
What ran |
| Paper 1.21.1 |
all 16 weapons, every trigger, GUI, recipes |
| Paper 1.21.11 |
all 16 weapons, every trigger, GUI, recipes |
| Folia 1.21.11 |
all 16 weapons, every trigger, GUI, recipes |
| Paper 26.2 |
start, weapon loading, commands, reload, recipes |
The first three were driven by a bot that equips every weapon, hits, right clicks, sneaks, shoots
and opens the menu, with the console log checked for errors afterwards. On 26.2 the same bot
cannot log in yet because its protocol library stops at 26.1, so that column is the server side
only, on top of a compile run against the 26.2 API.
The arsenal
| Weapon |
Item |
Abilities |
| Voidreaper |
Netherite sword |
Void Mark, Rift Step, Collapse |
| Stormbreaker |
Netherite axe |
Arc Chain, Thunderclap |
| Frostbite |
Diamond sword |
Deep Chill, Glacial Prison |
| Emberlash |
Iron sword |
Searing Cut, Falling Ember, Pyre |
| Gravewalker |
Netherite hoe |
Rot, Soul Harvest, Grave Tribute |
| Tempest |
Bow |
Triple Gale, Burst Arrow |
| Siphon Blade |
Iron sword |
Siphon, Backlash |
| Bulwark |
Shield |
Aegis Dome, Repel |
| Riftpiercer |
Trident |
Seeking Throw, Rift Pull |
| Thunderhoof |
Mace |
Desperate Might, Skyward, Ground Zero |
| Wraithfang |
Iron sword |
Fang Strike, Shadowstep |
| Sunflare |
Crossbow |
Flare Volley, Flashburn |
| Titanbreaker |
Diamond axe |
Sunder, Seismic Slam |
| Serpent's Kiss |
Golden sword |
Venom, Venom Bloom |
| Gale Edge |
Diamond sword |
Tailwind, Gale Dash, Updraft |
| Nullblade |
Netherite sword |
Nullify, Null Field, Cleanse |
Every weapon has its own crafting recipe, its own permission and appears in the arsenal GUI.
Commands
| Command |
Permission |
Description |
/wu |
weaponsultimate.gui |
Opens the arsenal |
/wu give <weapon> [player] [amount] |
weaponsultimate.give |
Hands out a weapon |
/wu list |
weaponsultimate.use |
Lists every loaded weapon |
/wu info <weapon> |
weaponsultimate.use |
Shows item, permission and abilities |
/wu effects |
weaponsultimate.admin |
Lists every available effect type |
/wu reload |
weaponsultimate.reload |
Reloads config, weapons, messages and recipes |
/wu clear-cooldowns [player] |
weaponsultimate.admin |
Clears running cooldowns |
Aliases: /weaponsultimate, /weapons, /arsenal.
Per weapon access is granted with weaponsultimate.weapon.<id>, for example
weaponsultimate.weapon.voidreaper. weaponsultimate.admin bypasses all of them.
Building a weapon
weapons:
example-blade:
material: DIAMOND_SWORD
name: '&b&lExample Blade'
lore:
- '&8Written in ten lines.'
enchantments:
sharpness: 2
unbreakable: true
damage-bonus: 1.5
recipe:
shape:
- ' D '
- ' D '
- ' S '
ingredients:
D: DIAMOND
S: STICK
triggers:
attack:
name: 'Frost Cut'
description:
- 'Slows whoever it touches.'
cooldown: 3
effects:
- type: potion
effect: SLOWNESS
duration: 60
amplifier: 1
- type: particle
target: victim
particle: SNOWFLAKE
amount: 12
right-click:
name: 'Leap'
cooldown: 8
effects:
- type: dash
power: 1.4
- type: slow-fall
duration: 60
Triggers: attack, attacked, kill, death, right-click, left-click,
sneak-right-click, sneak-left-click, shoot, projectile-hit, hold.
Every effect understands target, radius, angle, max-targets, players-only, delay,
chance, repeat and period on top of its own keys. The complete list of effect types with
all their parameters is in EFFECTS.md.
Configuration
config.yml holds the server wide switches: world black or whitelist, per weapon permissions,
crafting, anvil protection, the feedback channel for cooldown and ability names, the lore
generator, the GUI layout and a global damage scale for quick balancing.
messages.yml holds every string the plugin sends, including the trigger names used in the
generated lore. & colour codes and &#RRGGBB hex colours are supported.
API
Weapon weapon = WeaponsUltimateApi.weapon("voidreaper");
ItemStack item = WeaponsUltimateApi.item("voidreaper");
Weapon inHand = WeaponsUltimateApi.weaponOf(player.getInventory().getItemInMainHand());
// Own effect types, registered before the next reload
WeaponsUltimateApi.effects().register("my-effect", section -> {
double power = section.getDouble("power", 1.0);
return context -> context.caster().setVelocity(context.caster().getVelocity().multiply(power));
});
Building from source
mvn clean package
The jar lands in target/WeaponsUltimate-<version>.jar.
License
GNU General Public License v3.0, see LICENSE.
Author
Made by LucasTHCR. Questions, ideas and bug reports: dc.gg/paperstream.
评论 0
登录后参与评分
还没有评论,来抢沙发吧