I was messing with command blocks today and I tried to put colored carpet on my head. I don't really know that much about command blocks and that kind of stuff. I already know /replaceitem entity @p slot.armor.head minecraft:carpet 1 0, but I want to know the command for colored carpet.

1 Answer 1


The replaceitem syntax for entities is:

/replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]

The carpet's colour is represented by its data value (sometimes called "damage value"). Currently you have it set to 0, which is white. You can see these values here.

For example, for lime carpet:

/replaceitem entity @p slot.armor.head minecraft:carpet 1 5
  • Thanks SirBenet- I haven't been on this website in a while, and I realized that you answered my old question already. I figured the answer out months later.. I'm an idiot.
    – rager
    Aug 7, 2017 at 22:56

You must log in to answer this question.

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