[Help] Can't transfer inventory from player to block

Started by Kaliross on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Help] Can't transfer inventory from player to block
Mon, 04/24/2023 - 19:35 (edited)

I'm trying to transfer all the inventory of a player to a block, spawned on the place were he dies (on MCreator 2023.1 for forge 1.18.2).

I was able to make the block spawn but i'm having issues with the inventory transfer.

Here the screenshot of the procedure: 

""

The x, y and z are local variables where I've put the actual coordinates of the player when he died, and block_slot begins from 0 and is the slot of the bock GUI.

I really don't understand what I'm doing wrong...the exp bottle part works but the for each with the itemstack iterator no.

 

UPDATE:

I think it's a problem of the event/target entity (this procedure uses the global trigger "when entity dies") because I tried to apply that "code" to the block right clicked trigger and it works. Any ideas how to solve it?

Edited by Kaliross on Mon, 04/24/2023 - 19:35
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try to use Entity Iterator…
Tue, 04/25/2023 - 20:39

Try to use Entity Iterator instead of Event/Target Entity and check if the Entity Iterator is the Event/Target Entity inside the For each Slot Block.

Maybe this fixes it.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey, I'm terribly late to…
Wed, 04/17/2024 - 20:56

Hey, I'm terribly late to this reply, but have you checked if it works if you set your slot selector with the [local number variable +1] inside a "repeat n times" (where n would be the max number of slots to check) block/loop?

I'm triyng this for a similar use case right now.