(I STILL NEED HELP) How to check for multiple of the same item in the player's inventory?

Started by Cole Snapper on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(I STILL NEED HELP) How to check for multiple of the same item in the player's inventory?
Sat, 03/15/2025 - 21:07 (edited)

I'm trying to make a block that, when right clicked, removes multiple of the same item from the player's inventory in order to craft something. But, I can't find anything that will let me do that. The only thing I found was the "Has Event/target entity inventory" block but, that only lets me check for a singular item, not multiple of the same. I tried to use this block twice but, I think that only checks for the same item twice, and what I want to do is if the player doesn't have enough of a certain item, then nothing will be crafted.

Edited by Cole Snapper on Sat, 03/15/2025 - 21:07
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I made a procedure that…
Tue, 03/04/2025 - 10:54

I made a procedure that sends to chat the exact number of diamonds in a player's inventory, modifying it you should be able to use it in your mod to check if the player has enough items

https://imgur.com/a/fEK8xFL 

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would do that but, it…
Tue, 03/04/2025 - 21:27

I would do that but, it requires the itemstack dependency, which blocks cannot use when right clicked.