功能说明
SpearAttributeSwapFixer 是一款面向 Spigot、Bukkit 和 Paper 的服务端插件。每当玩家切换快捷栏至长矛时,他们将获得一次无攻击冷却的刺击,从而立即启用其“冲刺”(Lunge)效果。完成该次刺击后,正常的原版攻击冷却将生效,直到下一次切换快捷栏为止。若未进行切换,则不会发生任何变化。
设计初衷
原版长矛会对刺击动作施加冷却时间,且该冷却也会限制“冲刺”效果的触发。通常在切换到长矛后,玩家需要等待其重新充能。本插件允许每次切换快捷栏后获得一次可用的刺击,其余机制保持原版不变。
工作原理
- 将快捷栏切换至长矛会激活一次免费刺击。
- 为玩家临时添加一个攻击速度修饰符。由于客户端通过攻击速度属性来检查长矛冷却,因此该修饰符是使刺击立即可用的关键。在服务器允许的情况下,服务端的攻击冷却计数器也会针对此次攻击进行填充。
- 一旦使用了该免费刺击,修饰符将被移除,随后恢复正常冷却机制。
- 如果未使用免费刺击,它将在可配置的时间后过期(默认 2 秒),或者当玩家切换至非长矛物品、离开服务器或插件被禁用时失效。
- 再次切换至长矛会激活另一次免费刺击。
- 在 Spigot 和 Bukkit 上,该修饰符为常规类型,因此插件还会在玩家加入或插件启动/停止时移除任何残留的修饰符。
原版“冲刺”规则仍然适用
本插件仅移除了冷却限制,并未改变“冲刺”本身的行为,因此以下情况仍会阻止冲刺:
- 饥饿值低于或等于 6 点
- 在水中、骑乘生物或使用鞘翅滑翔
- 蓄力攻击(“冲刺”仅对刺击有效)
命令与权限
| 命令 |
权限 |
描述 |
/spearswapfixer (别名 /ssf, /spearswarpfixer) |
spearswapfixer.use (默认: op) |
开启或关闭插件 |
配置
enabled: true
zero-cooldown-ticks: 40 # 切换快捷栏后免费刺击的有效时长(20 tick = 1 秒);设为 0 表示直到使用或切换出长矛前一直有效
attack-speed-boost: 1000 # 临时攻击速度加成;数值必须较大,请勿设置为 0
hand-swap-triggers: false # 是否也通过副手切换键触发
lunge-only: false # 仅计算附魔了“冲刺”的长矛
## 指标统计
本插件使用 [bStats](https://bstats.org) 收集匿名使用统计数据(包括服务器软件及版本、玩家数量、插件版本)。你可以在插件的 `config.yml` 中设置 `metrics: false`,或在 `plugins/bStats/config.yml` 中全局禁用。
What it does
SpearAttributeSwapFixer is a server-side plugin for Spigot, Bukkit and Paper. Every time a player swipes their hotbar to a spear, they get one spear jab with no attack cooldown, so the Lunge dash on it is instantly available. After that jab, the normal vanilla cooldown applies until the next swipe. Without a swipe, nothing changes.
Why
Vanilla spears put a cooldown on the jab, and that cooldown also gates Lunge. After swapping to a spear you usually have to wait for it to recharge. This plugin gives you one ready jab per swipe and leaves everything else as vanilla.
How it works
- Swiping the hotbar to a spear arms one free jab.
- A temporary attack speed modifier is applied to the player. The spear cooldown check is done by the client using the attack speed attribute, so the modifier is what makes the jab available. Where the server allows it, the server-side attack cooldown counter is also filled for that attack.
- As soon as the jab is used, the modifier is removed and the normal cooldown takes over.
- If the free jab is not used, it expires after a configurable time (default 2 seconds), or when the player swipes to a non-spear item, leaves the server, or the plugin is disabled.
- Swiping to a spear again arms another free jab.
- On Spigot and Bukkit the modifier is a regular one, so the plugin also removes any leftover modifier when a player joins or the plugin starts or stops.
Vanilla Lunge rules still apply
The plugin only removes the cooldown. It does not change Lunge itself, so these still block the dash:
- Hunger of 6 points or less
- Being in water, riding a mount, or gliding with an elytra
- Charge attacks (Lunge only works on the jab)
Commands and permissions
| Command |
Permission |
Description |
/spearswapfixer (aliases /ssf, /spearswarpfixer) |
spearswapfixer.use (default: op) |
Toggle the plugin on or off |
Configuration
enabled: true
zero-cooldown-ticks: 40 # how long the free jab stays available after a swipe (20 ticks = 1 second); 0 = until used or the player swipes away
attack-speed-boost: 1000 # temporary attack speed bonus; must be large, do not set to 0
hand-swap-triggers: false # also trigger with the offhand swap key
lunge-only: false # only count spears that have the Lunge enchantment
## Metrics
This plugin uses [bStats](https://bstats.org) to collect anonymous usage statistics (server software and version, player count, plugin version). You can disable it with `metrics: false` in the plugin's `config.yml`, or globally in `plugins/bStats/config.yml`.
评论 0
登录后参与评分
还没有评论,来抢沙发吧