The Meaning of Life, the Universe, and Everything.
Join Date:
2/26/2015
Posts:
277
Minecraft:
piipeeck
Member Details
Hi guys, this is the problem:
/execute @e[type=Player] is the same as /execute @a right?
so:
I want to execute command (let it be /say hi) ONLY at players who have diamond_boots nammed ''Water Boots'' at the slot 100b. Please can you write the whole command below? thanks
The Meaning of Life, the Universe, and Everything.
Join Date:
5/24/2015
Posts:
319
Minecraft:
WhiteAutumn
Member Details
Greetings!
I've made the mechanic you requested!
Here's how it works:
Command block A is set to repeat with always active and has this command in it:
/scoreboard players tag @a add WaterBoots {Inventory:[{Slot:100b,id:"minecraft:diamond_boots",tag:{display:{Name:"Water Boots"}}}]}
The command checks for a player with diamond boots in slot 100b and if it finds one it will give that player the tag "WaterBoots"
Command block B is set to chain with always active and has this command in it:
/execute @e[tag=WaterBoots] ~ ~ ~ /say hi
The command executes "/say hi" at all players with "WaterBoots" tag
Command block C is set to chain with always active and has this command in it:
/scoreboard players tag @a[tag=WaterBoots] remove WaterBoots
The command removes the tag from everyone. This is so that command block B won't continue spamming "hi" when the player does not have the boots in slot 100b
Flaws with the design:
Since the "WaterBoots" tag is constantly being applied and removed it's unreliable to reference it outside of the command line I've set up.
You can put all your commands who will use the tag between A and C
/execute @e[type=Player] is the same as /execute @a right?
There is one major difference between the two: the @a selector can target dead players while the @e selector cannot. You can use @e[type=Player] to ensure you do not target dead players if doing so would be problematic.
In 1.9, all entities have a "Tags" tag that holds a list of strings. /scoreboard can add and remove data from that list. The major benefit to this is being able to create entities with tags pre-defined, not to mention reducing the number of records there are in scoreboard.dat since the data is stored on entities instead of on the scoreboard. The "tag" parameter for target selectors can select a target based on a tag that may have.
the goal was to make it in one command. This will work or not?
/execute @a{Inventory:[{Slot:100b,id:"minecraft:diamond_boots",tag:{display:{Name:"Water Boots"}}}]} ~ ~ ~ /say hi
?
thanks for help
That will not work, dataTags are a part of command syntax instead of selector syntax. If the command itself does not support dataTags, then you cannot use dataTags directly in that command (which is why /scoreboard is necessary).
Hi guys, this is the problem:
/execute @e[type=Player] is the same as /execute @a right?
so:
I want to execute command (let it be /say hi) ONLY at players who have diamond_boots nammed ''Water Boots'' at the slot 100b. Please can you write the whole command below? thanks
piipecek
Greetings!
I've made the mechanic you requested!
Here's how it works:
Command block A is set to repeat with always active and has this command in it:
The command checks for a player with diamond boots in slot 100b and if it finds one it will give that player the tag "WaterBoots"
Command block B is set to chain with always active and has this command in it:
The command executes "/say hi" at all players with "WaterBoots" tag
Command block C is set to chain with always active and has this command in it:
The command removes the tag from everyone. This is so that command block B won't continue spamming "hi" when the player does not have the boots in slot 100b
Flaws with the design:
Since the "WaterBoots" tag is constantly being applied and removed it's unreliable to reference it outside of the command line I've set up.
You can put all your commands who will use the tag between A and C
There is one major difference between the two: the @a selector can target dead players while the @e selector cannot. You can use @e[type=Player] to ensure you do not target dead players if doing so would be problematic.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
how does the tag scoreboard work?
My recent creation
- Apocalyptic Disasters - Command block mod
My best Minigame
- Hangman
My best one command creation
- 1.9 Jetpack in minecraft
In 1.9, all entities have a "Tags" tag that holds a list of strings. /scoreboard can add and remove data from that list. The major benefit to this is being able to create entities with tags pre-defined, not to mention reducing the number of records there are in scoreboard.dat since the data is stored on entities instead of on the scoreboard. The "tag" parameter for target selectors can select a target based on a tag that may have.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Sorry for replying so late,
the goal was to make it in one command. This will work or not?
/execute @a{Inventory:[{Slot:100b,id:"minecraft:diamond_boots",tag:{display:{Name:"Water Boots"}}}]} ~ ~ ~ /say hi
?
thanks for help
That will not work, dataTags are a part of command syntax instead of selector syntax. If the command itself does not support dataTags, then you cannot use dataTags directly in that command (which is why /scoreboard is necessary).
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
There is no way to make it in to one command. You need to use data tags and /execute doesn't support them.
This scoreboard thing works. But for simpler things just use @e[tag=InsertTagHere]
Do you know how old this thread is? xD