How can I use /setblock in 1.12 to make a blue banner?

This answer is for 1.12 and older versions.


Your attempt using Base:4 is the closest to the correct way. However, this is attempting to set a data value. This only sets the direction of the standing banner, not the background colour.

You need to move the Base:4 to the area where NBT tags are stored, in the {}s after the data value and old block handling.

/setblock ~ ~ ~ minecraft:standing_banner 0 replace {Base:0}

Here's a refresher of the possible values for the banner, for yours and the viewers' conveniences.

  • 0: Black
  • 1: Red
  • 2: Green
  • 3: Brown
  • 4: Blue
  • 5: Purple
  • 6: Cyan
  • 7: Light Gray
  • 8: Gray
  • 9: Pink
  • 10: Lime
  • 11: Yellow
  • 12: Light Blue
  • 13: Magenta
  • 14: Orange
  • 15: White