forum Forumsplay_arrow Minecraft fiber_manual_record Redstone

1

Command block issues

1 emerald8 replies162 views
created 02/08/2019 11:21 pm by RoseWarrior
last reply 02/18/2019 5:54 pm
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 avatar
RoseWarrior
Level 4 : Apprentice Miner
0

8 replies

1
02/18/2019 5:54 pm
Level 11 : Journeyman Engineer
SUPERIONtheKnight
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 pm
Level 42 : Master Crafter
DiamondPlayables
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 4 : Apprentice Miner
RoseWarrior
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 am
Level 28 : Expert Pig
Roroo
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 pm
Level 4 : Apprentice Miner
RoseWarrior
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 30 : Artisan Ninja
Greystalk
avatar
Try this.

/execute as @a[nbt={Inventory:{Slot:102b,tag:{spec:Fun}}}]
1
02/09/2019 9:32 pm
Level 4 : Apprentice Miner
RoseWarrior
avatar
did not work for me but maybe I did something wrong with the item?
1
02/10/2019 1:29 am
Level 30 : Artisan Ninja
Greystalk
avatar
maybe, sorry it didn't work. I didn't have time to test it.

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome