This command changes the 'essential status' of the NPC with the specified ID. When an NPC is essential, it cannot be killed.
setessential [npc id] [essential status]
|NPC ID||The ID of the NPC you wish to change the essential state of. Note this should be the base ID of an NPC, rather than an NPC's reference ID.|
|Essential Status||Specify 0 here to set the NPC as non-essential, specify 1 here to set the NPC as essential.|
setessential 001423A8 1
This command will make the NPC with ID 001423A8 (Glowing Deathclaw) an essential NPC. Note that the ID provided should be a base ID, not a reference ID. The effects of this command will be applied to a type of NPC (like a species), not an individual NPC.