Item That Opens A Blocks Inventory From Anywhere

Started by gr33ntimer15 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item That Opens A Blocks Inventory From Anywhere

As items With Inventorys Seem to Be broken i have been trying to make an item open the inventory of a set block. And i Just Can't Seem To Get it To Work I tried storing the block i want's Location As NBT number Tags. And Simulating A right click on that block But It Dosn't Work Anyone have any ideas on how i could make this work?

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First, I do think item…
Wed, 04/06/2022 - 18:51

First, I do think item inventories work. The problem is probably you used "Get copy of item", which doesn't actually change the item inventory at all. Use some local variables and it should work.

Otherwise, use the item to open up a new GUI and load in slots with a procedure from there. Once you close it, have it save the new slots in the block.

Best I can do without any other info such as picture of procedure.

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I Was just having the item…
Wed, 04/06/2022 - 21:22

I Was just having the item open an inv that was linked to it at one point and i wouldn't compile properly i never used "get copy of item" I have my items right click procdeure testing for an nbtLogic tag called "PlacedBlock" if it returens =false it places the block Sets The items NBTLogic Tag "PlacedBlock" to True  then Sets NBT# thatLocX, LocY, and LocZ To the blocks cordanates of the block that just got placed  and when right clicked and PlacedBlock "Returns" =True it simulates right click by using the NBT# tags to Input the Cords

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
my origanal idea was like a…
Wed, 04/06/2022 - 21:22

my origanal idea was like a backpack but it dosnt compile

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm can I see procedure…
Wed, 04/06/2022 - 21:31

Hmm can I see procedure screenshot? There might be something else causing the error.

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh right! I forgot images…
Wed, 04/06/2022 - 21:35

Oh right! I forgot images break in mcreator.

Try using imgur or something. I can't see it.

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wait nvm it loaded
Wed, 04/06/2022 - 21:36

wait nvm it loaded

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Placeing the block works its…
Wed, 04/06/2022 - 21:36

Placeing the block works its the second right click that does not its not opening the blocks inv

 

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok see if this works:…
Wed, 04/06/2022 - 21:39

Ok see if this works:

Instead of simulating right click, have it open up the GUI using the "Open GUI" command.

Then load in the items into the slots manually from the block's storage.

Add a procedure that saves it when the GUI is closed.

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Would be a lot of Blocks id…
Wed, 04/06/2022 - 22:13

Would be a lot of Blocks id have to add as the inventor has 36 Slots

 

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Loops are your best friend…
Thu, 04/07/2022 - 20:43

Loops are your best friend for that sort of thing.

Create a local variable, give it any name like "index".

Loop for 36 times, increasing the local variable by 1 for each time.

Use the local variable to select the slot.

 

Or you could just do it manually, but it would take a while.

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Aparently My Origanl idea…
Fri, 04/08/2022 - 16:52

Aparently My Origanl idea was a bug with the last snapshot that is fixed now So im just going back to that