I am trying to make items that give the holder potion effects.
Here's my item.
/execute if entity @a[nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:"{\"text\":\"The Power Nugget\",\"color\":\"gold\",\"bold\":\"true\"}"}}}}] run effect give @p minecraft:regeneration 2 1 true
It works just fine, Alone.
But when I have other players on the realm they get the potion effects if they are closer to the command block. This is because I use @p at the end.
A potential solution I came up with was
/execute if entity Cthulhu548[nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:"{\"text\":\"The Power Nugget\",\"color\":\"gold\",\"bold\":\"true\"}"}}}}] run effect give Cthulhu548 minecraft:regeneration 2 1 true
Then have a command block for each player
But this doesn't seem to work
@s causes the command block to have no effect
the message I get is
"Expected whitespace to end one argument, but found trailing data at position 29:...Cthulhu548<-"
I have no idea why it works fine if I change Cthulhu548 to @p but not the other way around.
"Expected whitespace to end one argument, but found trailing data at position 29:...Cthulhu548<-"
I have no idea why it works fine if I change Cthulhu548 to @p but not the other way around.
if your using @s, your name shouldn't be anywhere in the command block.
this command should work:
/execute as @a[nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:'{"text":"The Power Nugget","color":"gold","bold":true}'}}}}] run effect give @s minecraft:regeneration 2 1 true
The Meaning of Life, the Universe, and Everything.
Location:
Earth
Join Date:
11/24/2017
Posts:
98
Minecraft:
Rocker09871
Discord:
Rocker09871#9302
Member Details
what is the command your trying to use with @s? The command I gave above works for me.
also, the reason switching @a to your name doesn't work is because you can't use selectors with specific players, if you want to use specific players with that nbt, try using
/execute as @a[name="Cuthulu548",nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:'{"text":"The Power Nugget","color":"gold","bold":true}'}}}}] run effect give Cuthulu548 minecraft:regeneration 2 1 true
I am trying to make items that give the holder potion effects.
Here's my item.
/execute if entity @a[nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:"{\"text\":\"The Power Nugget\",\"color\":\"gold\",\"bold\":\"true\"}"}}}}] run effect give @p minecraft:regeneration 2 1 true
It works just fine, Alone.
But when I have other players on the realm they get the potion effects if they are closer to the command block. This is because I use @p at the end.
A potential solution I came up with was
/execute if entity Cthulhu548[nbt={SelectedItem:{id:"minecraft:gold_nugget",tag:{display:{Name:"{\"text\":\"The Power Nugget\",\"color\":\"gold\",\"bold\":\"true\"}"}}}}] run effect give Cthulhu548 minecraft:regeneration 2 1 true
Then have a command block for each player
But this doesn't seem to work
@s causes the command block to have no effect
the message I get is
"Expected whitespace to end one argument, but found trailing data at position 29:...Cthulhu548<-"
I have no idea why it works fine if I change Cthulhu548 to @p but not the other way around.
the command is executed from the command block, so the nearest person (to the command block) will get the effect.
Changing if to as and replacing @p with @s will solve the issue.
~Blue
Thanks for your idea. This didn't work.
I get no effects when holding the item.
if your using @s, your name shouldn't be anywhere in the command block.
this command should work:
summon minecraft:armor_stand ~ ~0.5 ~ {NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:leather_boots,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_leggings,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_chestplate,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:player_head,Count:1b,tag:{SkullOwner:"Rocker09871",display:{Name:'{"text":"ror","color":"yellow"}'}}}],HandItems:[{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}},{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}}],Pose:{RightArm:[-30f,-20f,20f],LeftArm:[-70f,30f],Head:[30f,0f]}}
with @s I still get no effect
what is the command your trying to use with @s? The command I gave above works for me.
also, the reason switching @a to your name doesn't work is because you can't use selectors with specific players, if you want to use specific players with that nbt, try using
summon minecraft:armor_stand ~ ~0.5 ~ {NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:leather_boots,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_leggings,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_chestplate,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:player_head,Count:1b,tag:{SkullOwner:"Rocker09871",display:{Name:'{"text":"ror","color":"yellow"}'}}}],HandItems:[{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}},{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}}],Pose:{RightArm:[-30f,-20f,20f],LeftArm:[-70f,30f],Head:[30f,0f]}}