

To store all this wheat, we'd need 40 slots of inventory space - that means we'd need at least one double chest. That would mean our farm produced:įloor(2,500/64) = floor(39.06) = 39 stacks Suppose the wheat farm runs for 10 hours and delivers the promised 2,500 wheat. Our wheat farm would therefore produce 3 stacks and 58 units of wheat every hour. Knowing the maximum stack size to be 64, we can calculate that 250 wheat translates to: Let's put what we've learned into practice. We need to devise a storage strategy, but we can't until we know how many stacks of wheat we'll be handling. Suppose we've designed a small automatic wheat farm that delivers a harvest of 250 wheat 🍞 items every hour. Total items = stacks * maximum stack size + leftover items. If we know how many stacks and leftover items we have, we can easily determine how many items we have in total with: Here, % is the modulo operator it means we use the remainder of the division between total items and maximum stack size. The number of leftover items can be calculated with leftover items = total items % maximum stack size. The floor operation means to round down to the nearest integer. The number of full stacks (that is, the number of slots that will contain the maximum number of items) can be determined with stacks = floor(total items / maximum stack size). Then, knowing the total number of items we have, continue with these two formulas: Most items stack to 64, but some only stack to 16. But how do we determine how many stacks an arbitrary number of items will fill up? And how many items will remain in a semi-full stack? We can calculate these with some quick formulas.įirst, determine whether the item's maximum stack size is 64 or 16. We've hopefully convinced you of the importance of item stacks.
