Help Needed: Using Multiple Blocks to Change Model while Keeping Associated GUI and Keeping the Inventory

Started by znaxcy on Sat, 06/22/2019 - 10:37

Topic category: Help with MCreator modding

Last seen on 12:47, 2. Jul 2019
Joined Jun 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help Needed: Using Multiple Blocks to Change Model while Keeping Associated GUI and Keeping the Inventory
Sat, 06/22/2019 - 10:38 (edited)

I'm trying to take a block with an associated GUI and change the model when a certain number of items are stored within the block's inventory.

Because there is no non-code way to change establish, define and change blockstates, I change models by creating new custom blocks and using a procedure to remove Block A and place Block B. This works fine.

The problem I'm having is with the GUI association feature. If I disassociate the GUI called when I right click Block A, the same GUI called in the same way from Block B doesn't inherit the inventory from Block A anymore and the GUI doesn't work properly. If I want to keep the GUI specific to Blocks A and B, do I have to create a new, identical GUI for each new block/model and then build into the block replacement procedure a function to carry over the inventory? Creating one GUI to be accessed universally from every Block A or Block B in the world is off the table.

Can anyone think of an easier/better way to do this?

If not, and if I do try to carry over the inventory from Block A to Block B, how should I do this? Using an int variable to move the number of items is easy, but what about carrying over an itemstack? Can I convert itemstack to a string variable in the procedure block editor somehow?

Edited by znaxcy on Sat, 06/22/2019 - 10:38