home Forumsplay_arrow Minecraft fiber_manual_record Redstone

1

Help with a command?

1 emerald1 reply121 views
created 01/20/2018 12:29 am by Drazzz
last reply 01/20/2018 10:52 am
I'm trying to give a score to a player if they have a certain item in their inventory

/scoreboard players set @a holdemeraldore {Inventory:[{id:minecraft:emerald_ore}]}

However when I try it I get the phrase "The Data Tag foes not match for (me)"

It does work if I use a selecteditem tag, but not an inventory tag
Posted by avatar
Drazzz
Level 1 : New Miner
0

1 reply

1
01/20/2018 10:52 am
Level 54 Grandmaster Cyborg
Pepijn
avatar
The syntax in 1.12 and below is
/scoreboard players set <targets> <objective> <score> <dataTag>You're not specifying a score in your command.

You also need to quote the ID in the recent versions.
But all this aside, I would not use scores for this, but tags:1.) /scoreboard players tag @a remove holdemeraldore
2.) /scoreboard players tag @a add holdemeraldore {Inventory:[{id:"minecraft:emerald_ore"}]}

These 2 commands will make sure only players who have emerald ore get the tag.

You can then check for these tags with @a[tag=holdemeraldore]

Search

Browse

Site

© 2010 - 2018
planetminecraft.com

Welcome