GM4_Datapacks icon indicating copy to clipboard operation
GM4_Datapacks copied to clipboard

Sneak-depositing 800 or more levels exceeds the max command length

Open misode opened this issue 4 years ago • 0 comments

Describe the bug

It is possible to hit the max command chain length limit (65536). This will cause the gm4_xp_storage:main function to stop running.

To Reproduce

Steps to reproduce the behavior:

  1. /xp set @s 800 levels
  2. Stand on an enderchest and deposit one level
  3. Sneak and notice your xp level drops to 749
  4. Notice you can no longer deposit xp and the actionbar message is not appearing anymore

Fix

This is a temporary fix, but decreasing the 50 levels limit would decrease the chance of this happening in survival. In the future we should look into optimizing the xp depositing algorithm.

misode avatar Apr 05 '20 11:04 misode