Auto Gather stops working and requires a reload to work again

Lately, some of my players have been having issues with the auto gathering feature - it sometimes seems to stop working and doesnt auto gather. 

If I reload the plugin, sometimes that fixes it. 

Worth noting - I am also using a plugin called "bag of holding" wich also has a gathering feature. Is is possible that these 2 are conflicting and if so, is there a way I can all gathering on both with a conflict? 

Thanks!

I'm not sure what would cause gather mode to stop working suddenly. Another plugin conflicting is a reasonable hypothesis.

Both Backpacks and BoH subscribe to player inventory events by adding an event listener directly onto the player inventory, but in an additive way, allowing both plugins to be notified of an item being added to the player inventory. This means they are mostly compatible, though there may be some nuances around which plugin gets notified first (e.g., one plugin may gather an item before the other gets a chance to evaluate it, possibly leading to player confusion).

It's possible that other plugins are also subscribing to the player inventory events but in a non-additive way, which would inadvertently remove the listeners added by Backpacks/BoH. The change is subtle from a code perspective, delineated simply be an = (non-additive) vs a combination += and -= (additive). You could try scanning the code of all your pligins for "onItemAddedRemoved" to see if any other plugins are interacting with the same events.

Merged post

Another thing worth mentioning is that, whenever this issue happens, most likely the player can mitigate the issue by simplying toggling gather mode off for all backpack pages, then back on for all the same pages. Doing this will add back the inventory listener and should fully restore gather mode for that player. The same should be true for Bag Of Holding, meaning that the player can toggle gather mode off for all the bags, then back on; or remove all the bags from the inventory and add them back. If this mitigation doesn't work, that's worth knowing since that could indicate some other issue is at play.

Thank you for the detailed response! 

That gives me a lot to work with! 

Same issue on my server. 

Players report that they tried what you suggested @WhiteThunder, they even tried relogging but no success. the only thing that works is as @nomad3211 mentioned is reloading the backpack plugin to fix it.

vmhB0b0xMCXgnF4.png Nomad3211

Thank you for the detailed response! 

That gives me a lot to work with! 

i have send you a dm. 

We are also having this issue, and we are also running a carbon server.

No other plugins relating to backpacks.

Please try this version of the plugin, which has a new debug command, backpack.debug.gather <player>.

https://github.com/WheteThunger/Backpacks/blob/master/Backpacks.cs

The command will print out some basic diagnostic info, as well as stats around items that have been gathered.

When a player starts facing this issue, please run the command, then have the player try picking up some more items which they expect to be gathered, then run the command again. The difference in stats before and after (if any) will help narrow down which root cause applied to the items the player tried to pick up. Please provide the before/after prints in this thread or over DM. Not every possible root cause is provided in the stats today (only 8 so far), so depending on the results provided to me, I might need to make follow-up changes to highlight other potential root causes.

@WhiteThunder

This worked for me. Special thanks from my players!