playerBase.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, items);
Replace LEVELORDER by PREORDER, INORDER or POSTORDER and items will be returned multiple times, making the server freeze.
Discovered this by trying to save to json player's inventory when they die. Needed preorder to spawn them in order, but I'm forced to use levelorder that makes some item disappear if inventory if full or almost full.