#Is it possible to replace an item inside the player's inventory without specifying its location?

1 messages · Page 1 of 1 (latest)

crude hazel
#

I'm trying to create a system when a player make contact with an entity, it will replace a specific item on the player's inventory without specifying its location so for short it will just replace the designated item

whole bobcat
crude hazel
#

imma try that

whole bobcat
#

You can use has item selector in the give command to test if the player has that item. Then, run the clear command with hasitem selector too.

#

@crude hazel ☝️

crude hazel
#

I will use execute right?

#

copy that

whole bobcat
crude hazel
#

ohhhh

#

@p[hasitem=]

#

got it

whole bobcat
# crude hazel `@p[hasitem=]`

Please make sure to add r too so it doesn't runs the command on a player far away if the nearest player doesn't have it.

#

I mean r (radius) target selector.

crude hazel
#

copy that, I'm aware that is for the radius

whole bobcat