Updated:

The finished command (Java 1.21.5+)

/summon wither_skeleton ~ ~1 ~ {CustomName:"Dark Knight",CustomNameVisible:1b,PersistenceRequired:1b,Tags:["boss"],Health:200f,attributes:[{id:"max_health",base:200},{id:"attack_damage",base:15}],equipment:{mainhand:{id:"netherite_sword",count:1},head:{id:"netherite_helmet",count:1},chest:{id:"netherite_chestplate",count:1}},drop_chances:{mainhand:0f,head:0f,chest:0f}}

Older versions write equipment and drop chances differently. Pick your version in the summon command generator instead of editing this by hand.

What each part does

PartMeaning
CustomNameName shown above the mob
CustomNameVisible:1bShow the name from any distance
PersistenceRequired:1bThe boss does not despawn when players walk away
Tags:["boss"]A label to select it later with @e[tag=boss]
attributesMax health, attack damage and other stats
Health:200fHealth when it appears; match it to max health
equipmentWeapon and armor slots
drop_chancesChance to drop each item on death; 0 means never

Raising Health alone does nothing past the normal limit. Raise max_health as well, or the extra health is cut off.

Show its health on a bossbar

/bossbar add mc:boss "Dark Knight"
/bossbar set mc:boss max 200
/bossbar set mc:boss color red
/bossbar set mc:boss players @a

Put this in a repeating, always active command block to keep the bar in sync:

/execute store result bossbar mc:boss value run data get entity @e[tag=boss,limit=1] Health

Remove the bar after the fight with /bossbar remove mc:boss. The bossbar guide covers colors and styles.

Mobs that make good bosses

Balancing the fight

Start with 100 to 200 health and adjust to your players' gear. Very high attack damage can kill a player in diamond armor in one hit. Resistance or Regeneration effects are another way to tune a boss without huge numbers.

Bedrock Edition

Bedrock /summon has no NBT, so health and equipment cannot be set in the command. You can name the mob (/summon wither_skeleton "Dark Knight" ~ ~1 ~), strengthen it with effects, or change the mob in a behavior pack.

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.