Help with checking the player's inventory

Started by ILikeMakingMods2103 on

Topic category: Help with MCreator software

Active 2 hours ago
Joined Jul 2021
Points:
659

User statistics:

  • Modifications: 3
  • Forum topics: 21
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 74
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.

Active 1 week ago
Joined Apr 2023
Points:
443

User statistics:

  • Modifications: 1
  • Forum topics: 16
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 381
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.