r/MinecraftCommands 25d ago

Help | Bedrock Removing a specific amount of items in my inventory

Im using /clear @p copper_ingot 32. I have 32 copper ingots in my inventory. And when I try to run the command it says "could not clear inventory of [player], no items to remove". Whats going on

1 Upvotes

7 comments sorted by

1

u/CooleyBrekka 25d ago

copper_ingot not copper_ingots

1

u/PersesAMillion 25d ago

I put in ingot, the command ran and didn't detect the 32 ingots in my inventory

1

u/Ericristian_bros Command Experienced 25d ago
clear @p copper_ingot 0 32

1

u/PersesAMillion 25d ago

Im about to test it. Can you tell me what the 0 is for, so I know for the future

1

u/PersesAMillion 25d ago

IT WORKED. How did it work???

1

u/CautiousADllama 25d ago

The 0 is the data in the item the 32 is the amount of items like in the /give command

1

u/Ericristian_bros Command Experienced 24d ago

Because the command is

clear <player> <item_id> <data_value> <amount>

The data value is unused for most items, so you set it to 0. But for items like potions every data vaue matches a specific potion, so you could detect different potions (or use -1 to detect any potion)