Project MMO

Project MMO

10M Downloads

Charging Vein Items Should Not Prevent Digging

Caltinor opened this issue ยท 1 comments

commented

Describe the bug
When an item with vein ability is recharging, the tool jerks up and down like it's being constantly reequipped. This causes any tool action to reset meaning that players are unable to dig with the item while it is recharging.

Expected behavior
The tool should not jerk and the player should be able to dig normally.

To Reproduce
Steps to reproduce the behavior:

  1. hold a tool with vein cap/charge in your mainhand
  2. Use the vein feature on a block and break it. This will consume the charge on your item.
  3. attempt to dig another block
  4. See error

Versions:

  • Minecraft: 1.19
  • Loader: 41.0.38
  • PMMO: 1.19-Dev

Additional context
The jerking occurs because the NBT of the item is being modified. If I understand correctly, this process creates a new item and replaces the previous one, which is interpreted on the client as an item swap.

commented

This issue requires further testing. the solution provided in 3f39eb6 is significant in reducing the frequency of resets, but does not eliminate them. Furthermore, it is likely that there is not a way to store charge on the item in a way that will prevent resets.

Potential alternatives include mixing into the reset logic and testing for whether the change is due to NBT (or more specifically vein values) and cancelling the reset, or storing charge elsewhere and giving items unique IDs that can be used to pair them with their externally stored charge data.