文本描述(无障碍转录)
Instant-Shield-Break v1.0
NETHPOT PVP · FABRIC MOD · 客户端模组
在 nethpot PvP 中,通过在攻击瞬间切换至斧头并立即还原,自动击破敌方盾牌,整个过程仅在一个游戏刻内完成。无需 GUI,无需按键绑定,始终处于激活状态。
标签: Fabric API · Java · MC 1.19–1.21 · 单刻切换 · 始终激活 · 零闪烁
⚙️ 切换机制详解
一个在五步流程中于单个游戏刻内完成的过程:
- 发起攻击 — 玩家击中敌人
- 盾牌检测 —
isUsingItem() 检测目标是否正在举起盾牌
- 切换至斧头 —
@Inject HEAD 将手持物品切换为斧头
- 斧头命中 — 盾牌失效
- 还原槽位 —
@Inject RETURN 瞬间还原回原始物品
? 模块分解
ShieldDetector (util/ShieldDetector.java)
通过 isUsingItem() 和物品身份检查,判断目标玩家是否正在主动举起盾牌。在 5 次举盾延迟发生前捕捉意图,确保不会漏判。
InventoryScanner (util/InventoryScanner.java)
优先扫描快捷栏槽位 0–8,随后扫描主背包槽位 9–35。缓存上次使用的斧头槽位,以便在重复攻击时快速查找。支持任何扩展自 AxeItem 的模组添加的斧头。
SwapHandler (handler/SwapHandler.java)
协调完整的切换序列。通过 150ms 冷却时间防止滥用。发送原版的 UpdateSelectedSlotC2SPacket 以实现服务器同步。在同一调用栈帧内完成还原——不消耗额外游戏刻。
Attack Mixin (mixin/ClientPlayerInteractionManagerMixin.java)
在 HEAD(发包前)和 RETURN(发包后)钩入 attackEntity()。仅拦截 PlayerEntity 目标——对生物的攻击则不作修改地放行。
Config (config/ShieldBreakConfig.java)
基于 GSON 的 JSON 配置文件位于 config/instant-shield-break.json。支持 enabled 开关、cooldownMs 调整以及用于详细输出的 debugLogging。首次启动时自动生成默认配置。
? 概览
| 统计项 |
数值 |
| 切换窗口(游戏刻) |
1 |
| 滥用冷却 |
150ms |
| 可见闪烁帧数 |
0 |
| 扫描的背包槽位 |
35 |
| Mixin 注入点 |
2 |
| 源代码模块 |
5 |
by Shubham96 · MIT License · Fabric 1.19–1.21 · instant-shield-break v1.0
Text Description (Accessibility Transcription)
Instant-Shield-Break v1.0
NETHPOT PVP · FABRIC MOD · CLIENT-SIDE
Auto-breaks enemy shields in nethpot PvP by swapping to an axe at the exact moment of attack,
then reverting instantly — all within a single tick. No GUI, no keybinds, always on.
Tags: Fabric API · Java · MC 1.19–1.21 · 1-tick swap · Always active · Zero flicker
⚙️ How the Swap Works
A five-step process that occurs within a single tick:
- Attack fired — player hits enemy
- Shield check —
isUsingItem() detects if the target is raising a shield
- Swap to axe —
@Inject HEAD swaps the held item to an axe
- Axe hits — shield is disabled
- Revert slot —
@Inject RETURN swaps back to the original item instantly
📦 Module Breakdown
ShieldDetector (util/ShieldDetector.java)
Checks if the target player is actively raising a shield via isUsingItem() + item identity
check. Catches the intent before the 5-tick raise delay, ensuring no missed hits.
InventoryScanner (util/InventoryScanner.java)
Scans hotbar slots 0–8 first, then main inventory slots 9–35. Maintains a cached
last-used axe slot for instant lookup on repeated attacks. Supports any modded axe
extending AxeItem.
SwapHandler (handler/SwapHandler.java)
Orchestrates the full swap sequence. Guards against spam with a 150ms cooldown. Sends a
vanilla UpdateSelectedSlotC2SPacket for server sync. Reverts in the same call-stack frame
— zero extra ticks.
Attack Mixin (mixin/ClientPlayerInteractionManagerMixin.java)
Hooks into attackEntity() at HEAD (pre-packet) and RETURN (post-packet). Only
intercepts PlayerEntity targets — mob attacks pass through unmodified.
Config (config/ShieldBreakConfig.java)
GSON-backed JSON config at config/instant-shield-break.json. Supports enabled toggle,
cooldownMs tuning, and debugLogging for verbose output. Auto-creates defaults on first
launch.
📊 At a Glance
| Stat |
Value |
| Tick swap window |
1 |
| Spam cooldown |
150ms |
| Visible flicker frames |
0 |
| Inventory slots scanned |
35 |
| Mixin inject points |
2 |
| Source modules |
5 |
by Shubham96 · MIT License · Fabric 1.19–1.21 · instant-shield-break v1.0
评论 0
登录后参与评分
还没有评论,来抢沙发吧