So I just had a thought. If I can make one Shulker Box and put a Shulker box in it with a Shulker box in it with a Shulker box in it repeat as many times as you want to, how much could I fit in my inventory? I think I can do infinite, just as long as it doesn't take up a lot of memory.
If you could put shulker boxes inside each other, you could actually have an infinite amount of items inside one shulker box, as long as you have loaded shulker boxes inside each other.
Now here we are going to solve how many items you can actually fit into one inventory.
There are 36 inventory slots with one available slot for shields, arrows, maps, totems of undying, etc., and 4 slots for armour. First, lets add up the armour and shield slots. That bring us up to 5 items. Now, if we fill a shulker box up with items, we can fit up to 27 slots, with 1728 items. Because there are 36 spaces in your inventory, we have to multiply the amount of items in the shulker boxes by 36. By doing that, we can get 62,208 items. If we include the shulker boxes themselves, we can fit up to 62,244 items and then finally we can add the remaining 5 slots from shields and armour. This totals up to a grand total of 62,249 items that you can fit into your inventory at one time.
Note: I'm not adding a shulker box into the off-hand because you are playing minecraft bedrock edition, but if you do want to add a shulker box into your off-hand, you can get up to another 1729 including the extra shulker box. This leads to another grand total of 63,978 items.
I’m coming from Java edition, but I’m pretty sure the game locks you out from doing just that, but assuming you could, I’m also curious how much you could fit before running out of memory.
Afaik Minecraft stores NBT data as a dictionary, and since you’re using Bedrock, that’s using C++ which is a good bit more memory efficient.
Let’s say the average length of an item name is roughly 10 characters, and every item name is preceded by “minecraft:”. This means that the name field is, as a very rough estimate, 21 bytes plus 8 bytes for the pointer on the stack. Then I’m pretty sure the Count is stored as a Short, which is 2 bytes, meaning 1 stack of items with no tags or other NBT is about 31 ish bytes. C++ probably also has to store a pointer for each item so that totals as 39 bytes. If you’re looking for a quick answer then this multiplied out would be about 25.6 million items able to be stored in a Gigabyte.
I’m not saying this is anywhere close to the answer but that’s probably within an order of magnitude