Can you detect items inside of another item?

Started by swelkinn_n on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you detect items inside of another item?

I'm trying to make an equipment menu akin to baubles/curios since I genuinely cannot for the life of me get curios to work in my mod, and I know you can't tie an inventory to the player since it clears whenever the menu is closed, which is why I'm wanting to make something like an accessory pouch , but I can't seem to find out how to, if I even can, detect what items are in another item's inventory when it's closed.

Any help is appreciated !

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I somewhat accomplished this…
Mon, 12/02/2024 - 02:45

I somewhat accomplished this, but it was saying there was some problems and how it "might not work all the time" due to something not automatically updating. I kinda accomplished this by changing (the value of) an nbt tag on the player depending on what was in the slot (and a globle trigger of "on player tick update"), settting the tag to 0 when you die (if keep inventory's off) and on another on player tick procedure, apply the effect based on the tag value. No idea if this'll work for you or help at all, haven't had much of a chance to test it.