How to understand the difference between a Chest and a double Chest?

Started by GuerraReturns on

Topic category: Help with MCreator software

Last seen on 21:26, 2. Mar 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to understand the difference between a Chest and a double Chest?
Tue, 11/28/2023 - 16:37 (edited)

Hello everyone! I need to calculate how many items are in a chest using a procedure I've already created. The problem is that the "Repeat X times" function only works if the slot exists within the loop; otherwise, the game crashes.

The script works like this: my local variable "Ciclo" starts from 0 and checks if certain items are present. If they are, it adds 1 to my Count, and I repeat the loop 27 times so that my "Ciclo" can reach 26 and find all the IDs inside the chest.


 

The issue is that if I input "54" (the value for a double chest) and try to check a single chest, the game crashes because the single chest only goes up to 26.

I don't know how to distinguish between a single chest and a double chest; both have "minecraft:chest," and using the "/data get block" command shows no differences (I have checked namespaces, etc., but found no distinctions). How can I figure this out?

It would be a great addition to directly include in procedures "Get available slots in block x y z," allowing me to use this value with my repeat and make my procedure compatible with all "chest" blocks in Minecraft.

Any ideas on how I can distinguish between them?

Edited by GuerraReturns on Tue, 11/28/2023 - 16:37