7

In Sethbling's snapshot 14w07b video, he uses a command block to give him jump boost while he is wearing his Boots of Leaping.

I am trying to imitate this for a multiplayer map I am making. Wearing golden boots called "Stealth Boots" is supposed to give that player invisibility. I am using this command:

/effect @a[Inventory:[{Slot:100b,tag:{display:{Name:"Stealth Boots"}}}]] 14 30000 200

I do know that in the video he is using a /testfor command, but since I'm making a multiplayer map in order to use this technique I'd have to define a scoreboard variable for each player - and even then, the players would be finite. Thus, I want to be able to use the command DIRECTLY.

When I use that command, it either says "That player cannot be found" or "The entity UUID provided is in an invalid format" - the former of which I'm familiar with; the later I've barely ever seen before.

So, my method doesn't seem to work - how do I fix it?

3 Answers 3

5

As of 14w10c, this is possible using scoreboard values.

First, you need to set up a dummy scoreboard variable. I used "sneaky" as my variable, but you can really use whatever you want (as long as you change the commands as appropriate). To set this up, you just need to use the command /scoreboard objectives add sneaky dummy. You only need to do this once.

I had to set up the command blocks in a very specific pattern for them to work, as shown:

Command block setup

I think this has something to do with how command blocks handle firing off "simultaneously". The comparator in this setup is in subtraction mode, creating a "comparator clock" which pulses very quickly.

The command blocks on the left are your scoreboard related commands. The one on the bottom left sets "sneaky" to 0 for all players:

/scoreboard players set @a sneaky 0

The command block on the top left sets "sneaky" to 1 for all players with the stealth boots equipped:

/scoreboard players set @a sneaky 1 {Inventory:[{Slot:100b,tag:{display:{Name:"Stealth Boots"}}}]}

The command blocks on the right are your effect commands. They give players the invisibility effect, or take it away, as appropriate. The one on the bottom clears the invisibility effect from all players without the stealth boots:

/effect @a[score_sneaky=0] 14 0 0

The top one gives the invisibility effect to all players with the stealth boots:

/effect @a[score_sneaky_min=1] 14 30000
6
  • Is there any indication it is an intended feature? Commented Feb 25, 2014 at 2:30
  • @JamesOfDaPeach Not that I can tell.
    – Unionhawk
    Commented Feb 25, 2014 at 2:54
  • Oh. :( Are you a command block expert & map maker like me? Commented Feb 25, 2014 at 2:55
  • I think this is now possible as of 14w10c using scoreboard values. I'll look into it tonight.
    – Unionhawk
    Commented Mar 10, 2014 at 15:41
  • Yes, this is possible as of 14w10a: "Command /scoreboard players can now filter by NBT data". I'll work on the commands needed and update my answer to reflect this change.
    – Unionhawk
    Commented Mar 10, 2014 at 16:03
2

This can be done without a scoreboard in 1.13, which added a "nbt=" selector argument:

/effect @a[nbt={Inventory:[{Slot:100b,tag:{display:{Name:"Stealth Boots"}}}]}] minecraft:invisibility 30000 200
-1

The Commands Are: POST THIS IN CHAT:/scoreboard objectives add WEAR_1 dummy /scoreboard players set @a WEAR_1 0 /scoreboard players set @a WEAR_1 1 {Inventory:[{Slot:100b,tag:{Unbreakable:1,display:{Name:"ARMOR NAME"}}}]} /execute @a[score_WEAR_1_min=1] ~ ~ ~ YOUR_COMMAND @a[score_WEAR_1_min=1]

Just one question, what slot is head, chest, leggings and boots as I'm confused, thanks!

1
  • If you want to ask a question, click the ask a question button at the top right, don't ask within the answer space.
    – Angzuril
    Commented Apr 8, 2017 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.