Itemstack size procedure blocks

Upvotes: 4
Issue description

The procedure blocks would be "Get stack size", "Set stack size to <amount>", "Shrink stack size by <amount>" and "Grow stack size by <amount>".

The required code is: 

// Get stack size
int amount = ItemStack.getCount();

// Set stack size
ItemStack.setCount(int amount);

// Shrink stack
ItemStack.shrink(int quantity);

// Grow stack
ItemStack.grow(int quantity);

In particular, the shrink block would be extremely useful for consumable items. Although there's a "Consume item in inventory" block, it isn't guaranteed to take the item from the active stack.

Issue comments

Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.