This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
I"m trying to make an execute command that executes the command when you are holding a specific item in slot number 1 in your active slot.
Right now, I have a testfor command for it:
/testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:diamond_sword"}]} (its a diamond sword i'm trying to detect)
but i want it to be in the execute command like this
execute @a[detects if you're holding an diamond sword] ~ ~ ~ (command)
I've tried doing this: execute @a[{SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:diamond_sword"}]}] ~ ~ ~ say I am holding a diamond sword
but it dosen't seem to work.
If anybody could help me with this it would be great!
Thanks!
Is there a way to set it to 0 when they're not holding it? (at all times)
EDIT: Nvm found a way.
No i meant when you're other slots are active your Holding score gets set to 0. Anyways, i figured it out.
I know that this is late, but could you add data to it? I'm trying to use logs, but i need different types of logs.
Thanks, maxaxik. That was a VERY quick response.
But the problem is i need it with a NAME too!
{SelectedItem:{id:"minecraft:log",Count:10b,tag:{display:{Name:"Plain Wood"}}}}
I know that it works, i just need to add the datatag WITH the name...
I"m trying to make an execute command that executes the command when you are holding a specific item in slot number 1 in your active slot.
Right now, I have a testfor command for it:
/testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:diamond_sword"}]} (its a diamond sword i'm trying to detect)
but i want it to be in the execute command like this
execute @a[detects if you're holding an diamond sword] ~ ~ ~ (command)
I've tried doing this: execute @a[{SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:diamond_sword"}]}] ~ ~ ~ say I am holding a diamond sword
but it dosen't seem to work.
If anybody could help me with this it would be great!
Thanks!
Is there a way to set it to 0 when they're not holding it? (at all times)
EDIT: Nvm found a way.
No i meant when you're other slots are active your Holding score gets set to 0. Anyways, i figured it out.
I know that this is late, but could you add data to it? I'm trying to use logs, but i need different types of logs.
Thanks, maxaxik.
That was a VERY quick response.
But the problem is i need it with a NAME too!
{SelectedItem:{id:"minecraft:log",Count:10b,tag:{display:{Name:"Plain Wood"}}}}
I know that it works, i just need to add the datatag WITH the name...