Is it possible to put colored armor on a player using a command?
Yes, it is possible to put colored armor on a person using a command.
To equip players with armor or other items, you can use the /replaceitem command.
The syntax of /replaceitem for replacing items in an inventory is /replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]
.
To do what you want, you can use the following commands:
Red colored leather armor
/replaceitem entity <player> slot.armor.head minecraft:leather_helmet 1 0 {display:{color:10040115}}
/replaceitem entity <player> slot.armor.chest minecraft:leather_chestplate 1 0 {display:{color:10040115}}
/replaceitem entity <player> slot.armor.legs minecraft:leather_leggings 1 0 {display:{color:10040115}}
/replaceitem entity <player> slot.armor.feet minecraft:leather_boots 1 0 {display:{color:10040115}}
Blue colored leather armor
/replaceitem entity <player> slot.armor.head minecraft:leather_helmet 1 0 {display:{color:6724056}}
/replaceitem entity <player> slot.armor.chest minecraft:leather_chestplate 1 0 {display:{color:6724056}}
/replaceitem entity <player> slot.armor.legs minecraft:leather_leggings 1 0 {display:{color:6724056}}
/replaceitem entity <player> slot.armor.feet minecraft:leather_boots 1 0 {display:{color:6724056}}
Simply replace <player>
with the player or entity you want to equip the armor on.
If you want to give the armor to a whole scoreboard team, you can replace <player>
with @a[team=<teamname>]'
.
If you want an other color than red or blue, you can simply Google "color picker" to find a color picker. When you have selected your color, you need to convert it from a hexidecimal to a decimal. For example, you can use this site. Enter the color value (example: #ffffff (white)) into the hexadecimal field without the hashtag and then press convert. Copy the number that appears into the hexadecimal field and replace <number>
in {display:{color:<number>}
with the decimal you just copied.
This question has already been answered here, but the answer is kind of outdated, so I will provide a new answer if that one does not work well.
Just make a small area that is 3x3 it will look like this:
[l][l][l]
[r][l][r]
[l][l][l]
[l] is lava and [r] is a repeating command block. If you wanted to join players to team red or blue, your command block commands would be these, /scoreboard teams join red @a[r=1,team=]
and /scoreboard teams join blue @a[r=1,team=]
. Then you would have a repeating command block with a spreadplayers command, /spreadplayers centerBlockX centerBlockZ 0 1 false @a[team=]
where centerBlockX and centerBlockZ are the coordinates of that middle lava block.
What this will do is spread the players inside of there, but it will only spread onto the command blocks since spreadplayers avoids lava. Then the command block joins anyone on top of it who is not on a team onto its team. You will also want to add a block to tp players out once they are on a team.
If you want to add additional teams, you can just place down more command blocks.
As for your question about the armor, you should use the replaceitem command. If you wanted to put a diamond chestplate in my chestplate slot for example, you would use this command, /replaceitem entity @p slot.armor.chest minecraft:diamond_chestplate
. The other slot names are feet, head and legs. You can read more about that here on the wiki.
Hope that answers your questions! :D