Help with checking the player's inventory

Started by ILikeMakingMods2103 on

Topic category: Help with MCreator software

Last seen on 01:16, 27. Apr 2024
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with checking the player's inventory

Hello, I've got a question:
I want to make it so whenever something is triggered, the player's inventory is checked for any (and I mean any) items, which will trigger X thing. How do I do this?

Just to make sure you understand: I'm not trying to check if there's a specific item in the player's inventory, but I want to check the very fact of the player having an item in  their inventory or not.

Last seen on 23:17, 26. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could probably use "for…
Fri, 04/21/2023 - 12:44

You could probably use "for each item in event/target entity inventory" and if itemstack iterator not air set a local logic variable to true

The downside with this is that you cannot modify the item as itemstack iterator is actually a copy that is not saved, but you can check items.