TransWikia.com

How to clear a specific number of a specific item from a players inventory?

Arqade Asked by A Cardboard Box on April 30, 2021

I am making a bed wars map and I wanna make it so when the player clicks a button, it give them 16 wool and takes away 4 iron. I have found out how to take only a specific item but how do I take a specific amount? For example, how I have it set up now, no matter how much iron the player has, it takes it all and only gives 16 wool. I want it to only take 16 at a time.

One Answer

Basically, the command is similar to /give; after you specify the item you need to specify the variant and amount. In this case, it would be

/clear @p minecraft:iron_ingot 0 4

0 is the variant, which in iron ingots there are none, but in things like colored blocks may need to be changed. The 4 is the amount.

Answered by EnderSkyeSong on April 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP