TransWikia.com

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?

Arqade Asked by pontorka on May 16, 2021

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?

2 Answers

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

Answered by ginkgo on May 16, 2021

do /clear (playername) and then the item example: Minecraft:stone 5. if you type that you remove 5 stone out of his inventory

Answered by jermy on May 16, 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