Skip to content

Custom mobs

DefineMob makes a mob out of a game species, and SpawnMob places it (or a game species: SpawnMob( "Wolf", at )):

var alpha = new PluginMob { Name = "Alpha Wolf", Base = "Wolf", Health = 500, Damage = 35, Scale = 1.5f, Aggressive = "yes", Tint = "#5a5a5a" };
alpha.Loot.Add( new PluginMobLoot { Item = "Leather", Min = 15, Max = 20 } );
DefineMob( alpha );
var animal = SpawnMob( "Alpha Wolf", position );
PluginMob
Name, Base Its name, and the game species it is made from: Chicken, Rabbit, Boar, Stag, Wolf, Bear, Mutant Wolf, Mutant Bear, Zombie, Fast Zombie, Slow Zombie
Health, Damage 0: the base’s
Speed, Scale Multipliers, 1 = the base’s
Aggressive "yes" hunts players, "no" flees, empty: as its base
Tint A colour on its skin, "#rrggbb"
Loot What butchering it gives (PluginMobLoot: Item, Min, Max); empty: the base’s

It keeps its base’s model and animations: the models of the s&box cloud have none of the Legacy animations, so a mob cannot use one. Custom mobs are removed when the plugins restart (spawn them again in OnLoaded if you want them to stay); game species spawned with SpawnMob stay like any animal.