Check if block inventory has item/remove 1 of item

Started by redwoodsteve on

Topic category: Help with MCreator software

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if block inventory has item/remove 1 of item

Hello, I was wondering if there was any way to check if a block inventory (a barrel in my case) contains an item (im checking for dirt). Also, is there a way to remove 1 of an item from an inventory? 

So I want to check if a barrel contains dirt. If it does, then remove 1 dirt from the barrel. 

Also, I want to add an item (bread) to a container without replacing any items.

 

Thanks!

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
bruh someone help meh im…
Mon, 01/02/2023 - 01:14

bruh someone help meh im gonna die of old age before some1 replies

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi! There is nothing…
Fri, 01/06/2023 - 06:36

Hi! There is nothing complicated here, first we need "if", then in the block procedures we find a block - "the block on x y z is - " then through logic we equate it to our barrel. Then, through the GUI procedures, we find out if there is our dirt in this GUI, through the logic of "and", and if we do everything correctly, we do it, "remove 1 dirt from the inventory", like everything, as I'm not busy, I can send a photo

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey is there a way to check…
Thu, 11/27/2025 - 14:30

hey is there a way to check if it is a container rather than a specific block? i want to make an item replace with another item if it exists in any chest, effectively replacing an item from another mod.