1

Command block issues

RoseWarrior's Avatar RoseWarrior2/8/19 11:21 pm
1 emeralds 271 8
2/18/2019 5:54 pm
SUPERIONtheKnight's Avatar SUPERIONtheKnight
Ok I am wanting to execute according to a item in a certain slot (in this case 102 or chestplate) with a certain tag

I understand that you can have

/execute as @a[nbt={Inventory:{Slot:102b,id:"minecraft:iron_chestplate"}]}]

but this will cause it to execute according to all iron chestplates that you wear
and I know you can do


/execute as @a[nbt={SelectedItem:{tag:{spec:Fun}}}]


But this means you have to have it in your hand is there anyway to combine the two into a single command?
Posted by RoseWarrior's Avatar
RoseWarrior
Level 13 : Journeyman Bear
0

Create an account or sign in to comment.

8

1
02/18/2019 5:54 pm
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
I know this is a little late, but hopefully it is helpful anyways.
/give @s iron_chestplate{spec:Fun}
/execute if entity @a[nbt={Inventory:[{Slot:102b,id:"minecraft:iron_chestplate",Count:1b,tag:{spec:Fun}}]}]
~SUPERIONtheKnight
1
02/09/2019 10:05 pmhistory
Level 82 : Elite Programmer
TheDiamondPlayables
TheDiamondPlayables's Avatar
When the item is added into the player's inventory, it simultaneously removes the item's tag.
I'd suggest you adding a special name to the item instead as it keeps the name, and work it from there.
You can color code the item name so that it is special, making it the only item that can be checked.
1
02/10/2019 2:41 pm
Level 13 : Journeyman Bear
RoseWarrior
RoseWarrior's Avatar
The problem with this is a item could completely break if you rename it so whats the point of a tag if its just instantly removed
1
02/09/2019 4:31 amhistory
Level 43 : Master Pig
Roroo
Roroo's Avatar
Let me get this straight.. You're trying to execute a command on a player wearing an iron chestplate and not other people also wearing the same chestplate?

If that's the case, try giving the chestplate a special name. That might make the player special, and add the itemname to the execute command.

Perhaps that works?
1
02/09/2019 5:52 pmhistory
Level 13 : Journeyman Bear
RoseWarrior
RoseWarrior's Avatar
What I am trying to do is execute according a chestplate with a tag when it is worn and that's the only time

/execute as @a[nbt={Inventory:{Slot:102b,tag:{spec:Fun}}}] run say hi

is what I attempted and several varients of it but I am not getting it
1
02/09/2019 1:51 am
Level 45 : Master Ranger
Greystalk
Greystalk's Avatar
Try this.

/execute as @a[nbt={Inventory:{Slot:102b,tag:{spec:Fun}}}]
1
02/09/2019 9:32 pm
Level 13 : Journeyman Bear
RoseWarrior
RoseWarrior's Avatar
did not work for me but maybe I did something wrong with the item?
1
02/10/2019 1:29 am
Level 45 : Master Ranger
Greystalk
Greystalk's Avatar
maybe, sorry it didn't work. I didn't have time to test it.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome