# INpcs interface

> Where a Plugin gives NPC classes, through its context's Npcs. A spawnable record names a class and a body; with the class registered, its body spawns with what the NpcClass says, and with none it stands as its body does.

Namespace `EvilEngine.Api.Npcs`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public interface INpcs
```

Where a Plugin gives NPC classes, through its context's [Npcs](/docs/api/plugincontext#npcs). A `spawnable` record names a class and a body; with the class registered, its body spawns with what the [NpcClass](/docs/api/npcclass) says, and with none it stands as its body does.

```csharp
context.Npcs.Register(ContentId.Parse("gmod:npc_zombie"), new NpcClass(50));
```

## Members

### Register (method)

```csharp
void Register(ContentId @class, NpcClass npc)
```

Registers a class while the Plugin loads, the later Plugin's winning, and the earlier's coming back when it unloads. Registering after loading throws, and so do health, most health or a model's health below 0 and a null `ModelHealth`. The class keeps its health by model as it was registered, so changing the dictionary afterwards changes nothing.
