Topic category: Help with Minecraft modding (Java Edition)
Perhaps I'm missing something obvious but I can not for the life of me figure out how to dynamically iterate how many slots a block like a chest or dispenser has. I'd like to be able to push items into an adjacent inventory which could be anything from a normal chest to some modded block with n slots.
In a similar vein. putting an item into an adjacent inventory (like a chest) by having to define which slot which seems limiting. I'd like to just put it into first available slot similar to how shift-clicking from your inventory into a chest does. either add it to a pre-existing non-full stack or put it into an empty slot. I'm almost sure I could maybe create a procedure to do this after a few headaches and tears, but I'd need to be able to iterate dynamically how many slots I'm dealing with.
If I'm not wrong the 00 slot has shift clicking priority. So in short terms the lowest number is the one it will prioritize.