How to check for block inventory size

Started by laugexd on

Topic category: Help with modding (Java Edition)

Last seen on 09:54, 26. Oct 2022
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check for block inventory size

I'm trying to make a block that moves a certain amount of items from one inventory to another, problem is, when the inventory that items get moved to is full, it continues to "move" items to it. Is there any way for me to check the size of an inventory so I can just check if it has hit the limit and stop it from trying to add more items?

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In Version 2020.3 I don't…
Mon, 07/06/2020 - 04:51

In Version 2020.3 I don't think you check any blocks inventory size, but you can do a procedure per block.

I made a procedure that checks 1 slot then then if that slot has the same item and is less than 64.

Then it will move 1 item into it until it's full. There is a problem with this method if you move an item that can't reach that stack size

it will break the code.

I could finish it but if what i said happens then oof.

There needs to be a way to Check items max stack size,As well as inventory slot count. Input slot and output slot count should be different. But anyway i could finish that code for you but you would have to tell me from what slot you want the items 

to move from. and other info maybe anyways i wish the best for you. :)

Last seen on 20:09, 15. Aug 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello, I have created a…
Mon, 05/02/2022 - 18:26

Hello, I have created a plugin for mcreator that adds a procedure block that obtains the total number of slots of a block in a certain position. Although the answer came late I hope the plugin will help you. 

you can find it here https://mcreator.net/plugin/86422/list-management