Summon an invulnerable mob using "/summon Chicken ~ ~ ~ {Invulnerable:1}"
Attempt to kill it using "/kill @e [type=!Player]."
The chicken will not get killed.
Linked issues
relates to 1
Comments 5
There should be brackets around the "type=!Player" (not sure why the mojira editor isn't putting those in), apparently, but it doesn't seem to have an effect; the player still gets killed.
That's probably another bug, but this one still stands; invulnerable mobs don't get killed.
As a command, /kill should take priority over any particular settings of the mob in question. It sounds contradictory to kill an invulnerable mob, but it would be a good method of controlling mob death. Instead of allowing the player to kill a boss, they must complete actions. The only thing better would be manually removing invulnerability from the mob, therefore allowing the player to manually kill, but in any case /kill should overtake invulnerability.
Edit: And he didn't add the brackets because the site does weird stuff to text in brackets. You have to use special format tags to fix that, which I'm not surprised the person didn't find.
There is also another bug, usually, when entities get into the void, they disapear, invulnerable mobs are falling just deeper.
This ticket has been marked as a duplicate of MC-44893, in favor of the more general or better information provided.
(Linked issue has been resolved)
I don't even get that command to work for anything.