How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate]
//ads -- adsterra.com -- native banner
?>
I know how to do it, with specific quantity of items, such as 2 ender eyes, for example:
/execute if data entity @p {Inventory:[{id:"minecraft:eye_of_ender",Count:2b}]}
But it doesn't work if the player has more than 2, what can I do?
Best Answer
Setup:
scoreboard objectives add eyesOfEnder dummy
Run these commands every tick:
execute store result score #count eyesOfEnder run clear @p minecraft:eye_of_ender 0
execute if score #count eyesOfEnder matches 2.. run clear @p minecraft:eye_of_ender 2
Pictures about "How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate]"
![How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - From below of crop multiethnic team of professional basketball players gathering and putting hands together while standing on playground before game How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - From below of crop multiethnic team of professional basketball players gathering and putting hands together while standing on playground before game](/assets/images/how_can_i_remove_a_specific_amount_of_items_from_a_player_with_commands_only_when_the_player_has_equal_or_more_than_the_requiered_items_duplicate_1.jpeg)
![How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - Faceless multiracial sport team stacking hands on court How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - Faceless multiracial sport team stacking hands on court](/assets/images/how_can_i_remove_a_specific_amount_of_items_from_a_player_with_commands_only_when_the_player_has_equal_or_more_than_the_requiered_items_duplicate_2.jpeg)
![How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - Person Holding Black and Green Tennis Racket How can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate] - Person Holding Black and Green Tennis Racket](/assets/images/how_can_i_remove_a_specific_amount_of_items_from_a_player_with_commands_only_when_the_player_has_equal_or_more_than_the_requiered_items_duplicate_3.jpeg)
How do you delete certain amounts of items in Minecraft?
You can clear items from a player's inventory using the /clear command in Minecraft....Clear Command in Minecraft Java Edition (PC/Mac)How do you quickly remove items from your inventory in Minecraft?
You can use the command /clear [targets] [item] [maxCount] , where: targets is optional. It is the name of the player (or a target selector) whose inventory you wish to clear. If no player is specified, it will default to the player running the command.Why Sudo Is The Best Command in Minecraft
More answers regarding how can I remove a specific amount of items from a player with commands, only when the player has equal or more than the requiered items? [duplicate]
Answer 2
do /clear (playername) and then the item example: Minecraft:stone 5. if you type that you remove 5 stone out of his inventory
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Yogendra Singh, Andrea Piacquadio, Monstera, Oliver Sjöström
