Item Use Delay Fixer
修复游戏中右键(使用物品)延迟计时器的行为。
Minecraft 的工作原理
在这方面,Minecraft 的逻辑很简单。当你按下右键时,它会将一个变量设置为 4。
该变量每刻(50ms)递减一次,一旦降至 0,如果你仍然按住右键,它会尝试再次使用物品。
问题在于?如果你没有可使用的物品或方块,它仍会将该变量重新设置为 4。
private void rightClickMouse() {
if (!this.playerController.getIsHittingBlock()) { // 如果不同时按下左键
// 将变量设置为 4
this.rightClickDelayTimer = 4; // 这是右键函数中执行的第一件事!
// ...
// 其余代码处理物品检测逻辑
}
}
这个模组做了什么?
这种行为相当烦人,因为如果你在过早或不恰当的时机开始按住点击,它会延迟你的物品使用,甚至可能导致无法使用。
因此,如果没有发生任何操作,该变量不会保持在 4,而是直接跳回 0,让函数在下一刻继续运行,直到满足条件为止。

此模组不是 FastPlace(或“快速物品”,无论人们现在如何称呼它以绕过作弊术语的说法)
兼容性/版本
该项目应适用于游戏的每个版本,支持 Fabric/NeoForge/Forge/Quilt。
在 Forge 1.13-1.16~ 上可能会出现问题,不确定。
它 应该 适用于 1.7-1.12.2 和 1.20-26.2 的所有版本(如果不兼容,请随时在我的 Discord 服务器上向我反馈)。
Item Use Delay Fixer
Fixes a behaviour in the game with the right click (use item) delay timer.
How Minecraft works
Minecraft is simple on that part. If you press the right click button, it sets a variable to 4.
This variable decreases every tick (50ms), and once it reaches 0, if you're still holding right click it'll try to use an item again.
The issue? What if you have no item, no block to be used. Then it still sets the variable to 4 again.
private void rightClickMouse() {
if (!this.playerController.getIsHittingBlock()) { // if not using left click at the same time
// set the variable to 4
this.rightClickDelayTimer = 4; // that's the very first thing done in the right click function!
// ...
// rest of the code with the item detection handling
}
}
What does the mod do?
That behaviour is pretty annoying, because it can make so if you start holding your click too early/at a bad timing, it delays your item use and could make it never happen.
So instead of staying at 4, if no action happened it jumps back to 0, letting the function run the tick just after too, for as long as needed.

This mod is NOT a FastPlace (or "Fast Item", whatever people call it nowadays to bypass the cheating term)
Compatibility/Version
This project should work with every version of the game, on Fabric/NeoForge/Forge/Quilt.
It may break on Forge 1.13-1.16~, unsure.
It should work on every version from 1.7-1.12.2 and 1.20-26.2 (feel free to report to me on my discord server if it doesn't)
评论 0
登录后参与评分
还没有评论,来抢沙发吧