Minecraft – Can I Store More Items Per Block Than a Chest?

minecraft-commandsminecraft-java-edition

Would there be a way to store more items per block than a Chest, for example, using some Redstone/commands? I need to store 60000 items (stackable by 64) in minimal space – less than the 35 Chests it would need (Chests aren't placable next to each other – it would need 70 blocks + the redstone to it I need). I also don't need to know where the items are.

Best Answer

You can use CommandBlocks to make a VIRTUAL chest, therefore you won't have items physically in game. The princip would be :

You have input and output chests (or hoppers etc, but less slots, better....furnace has only 3 easily distinguishable slots (you input in only one by one-side hopper) - but not all things can be inserted AFAIK). Then you need something to test if there are items in that slot, if there is expected thing, delete those things, add count to scoreboard. Then similar setup on output side.


Example:

Onetime command:

/scoreboard objectives add CobbleStorage dummy CobbleStorage

Setup: Furnace with hopper inserting into upper slot - so there will be maximum of 64 items at once. Commandblocks (if 1.9+, use chain ones, with "always running" as the first one (or clock for it)), replace x,y,z by real coords:

/testforblock x y z minecraft:furnace -1 {Items:[{Slot:0,id:cobblestone,Count:64}]}
--> if true (comparator or conditional chain)
/blockdata x y z {Items:[{Slot:0,id:cobblestone,Count:32}]}
-->comparator/conditional chain
/scoreboard players add <playername> CobbleStorage 32

Do notice that this setup can be done simultaneously for any number of players, if they all have their own input chest (or do it on @p basis in commands).

Then...we have stored our cobblestone in virtual manner. All you need is to do reverse technique to get it back.

For this you don't even need the storage block, you can do it on command basis. So commandblock with a button (or autocommand with /trigger so you can execute it from anywhere, even with ppl without OP)

/give @p[score_CobbleStorage_min=64,r=3] minecraft:cobblestone 64 
-->Comparator/conditional chain
/scoreboard players remove @p[score_CobbleStorage_min=64,r=3] CobbleStorage 64

Resume:

You need 1 hopper (possibly not), 1 Furnace, At least 5 commandblocks. And you are limited only by the maximum of scoreboard objective, which is diametrically higher than your needs. So unlimited storage for ~10 blocks.

PS: You always can have full inventory and just delete it and add that count by a command for faster insterting....but well, one slot is SAFER for number errors.