ViaVersion / ViaBackwards

Allows the connection of older clients to newer server versions for Minecraft servers.
https://hangar.papermc.io/ViaVersion/ViaBackwards
GNU General Public License v3.0
442 stars 85 forks source link

Crossbows do not retain charged state on 1.20.4 clients and below on 1.20.6 servers #787

Closed XDMAN500 closed 1 month ago

XDMAN500 commented 1 month ago

'/viaversion dump' Output

https://dump.viaversion.com/eefc32d5a14a721d901e1d0f2474fa392703705b039d2822d269e7a29b830143

Console Error

N/A

Bug Description

1.20.4 clients charging a crossbow on 1.20.6 servers are not properly updated to the charged state when charging completes. The crossbow appears undercharged for the client and but it is actually charged on changed for the server. The client need charge the crossbow again in order to fire the crossbow.

Steps to Reproduce

Start with a Paper 1.20.6 server with Viabackwards 5.0.0

  1. Login with a 1.20.4 client
  2. Obtain a crossbow, a stack of arrows, and enter survival mode.
  3. Completely charge the crossbow and notice that it revers to the uncharged state
  4. Charge the arrow again to fire the arrow.

Expected Behavior

The charged crossbow should show the charged crossbow model and fire an arrow after another interaction with the crossbow.

Additional Server Info

No response

Comments

The root cause of the issue is that the server does not send the client the Charged binary tag along with ChargedProjectiles tag. Setting the Charged tag to 1 when ChargedProjectiles is not empty should resolve the issue.

Here is a comparison of the client side view of the nbt data of a charged cross bow sent by a server between version 1.20.4 and version 1.20.6 captured with the NBT Tooltip Mod

1.20.4 ChargedProjectiles20_4

1.20.6

ChargedProjectiles20_6

Itemdata Data for Crossbows on 1.20.4: https://minecraft.wiki/w/Crossbow?oldid=2383107#Item_data

Checklist

Barvalg commented 1 month ago

Platform: 1.20.6--112--347bbe3%20%28MC%3A%201.20.6%29
ViaVersion (5.0.0): Even with master
ViaBackwards(5.0.0): Even with master