1

I'm making something where it sets the player to a random team using colored armor to determine each player's team. For example:

  • Red team: red leather armor
  • Blue team: blue leather armor

Is it possible to put colored armor on a person using a command?

2
  • 2
    Please only ask one question per post. I suggest staying with the first question, since it's more interesting (the second question is fairly straight forward if you look at the wiki). Also, are you playing on PC or PS4? It's hard provide answers for both, since there are slight differences in the two versions.
    – MBraedley
    Mar 11, 2017 at 2:42
  • Maybe you should have made a new post for this question, now my answer doesn't make much sense.. :P
    – El Six
    Mar 11, 2017 at 17:20

2 Answers 2

5

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.

1
  • 1
    I think the syntax has changed. This works for me in Java edition 1.16.1, for red leather armour. /replaceitem entity @p armor.chest minecraft:leather_chestplate{display:{color:10040115}}
    – Ashley
    Jul 19, 2020 at 12:33
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .