Issue:
Spear attack registration is not synced between the server and the client, unlike non stab-type weapon attack registration. This is a critical issue with spears in multiplayer environments. This desync becomes larger as the ping difference between the two players grows, and causes massively desynced gameplay. The spear user must attack infront of where the target is moving towards (where they will be visually in future ticks), otherwise the attack will ghost. In addition to the visual positions of the players being an indication of this issue, the on-hover attack indicator will give false-positive attack indications because of this.
Attachment visualizations:
Spear Server VS Spear Client: In the attached video, this issue is visualized with both what the client sees and what the server sees visualized simulatiously. The player that is not transparent is what the client sees, and the player that is transparent who lags behind is what the server sees.
Spear On-Hover Indicator False Positives: This issue can also be easily reproduced by chasing a player opponent and attempting to jab them when the on-hover attack indicator shows a successful attack can be performed, as the jab attack will always whiff unless the attacker is extremely close to the target, as that closeness allows the attacker to reach where the runner actually is on the server-side (further away than what is shown on the client, in this case).
Importance:
This is a critical issue for spears and is a result of design during the “stab weapon” type’s development that did not account for multiplayer in any meaningful way. This issue is also further compounded by https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-312214 and https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-308274.
Attachments
Comments 2
Spears check hits using where the server sees the target, which can differ from what the attacker sees because of lag. This forces players to aim ahead of moving targets and can make the attack indicator show a possible hit that actually misses.
Normal melee attacks handle this better: the client tells the server which entity the player attacked, and the server allows some extra distance when checking the hit. If the worry is a growing list of targets in the attack packet due to it's ability to attack multiple targets at once, sword sweeping also supports multiple targets without a fixed target-count limit, because the server chooses the additional targets itself.
Some community-made anticheats account for lag when checking attacks, and can even add lag compensation for spear attacks, but not every server can install them. Spears need reliable hit registration in vanilla multiplayer without requiring third-party fixes.
Thank you for helping us improve Minecraft! We saved your files: