The Mob class represents mobile creatures that are self-controlled and have a distinct behaviour.
The Mob class is a subtype of the Entity class and inherits all its properties and functions.
Here is an overview of the Mob properties:
Property | Type | read / write |
---|---|---|
ai | boolean | r/w |
health | number (float) | r/w |
mainhand | Item | r/w |
offhand | Item | r/w |
Below you find short descriptions about each of the properties and some examples about how to use them in your spells.
The ‘ai’ property defines whether this mobile creature is currently controlled by its artificial intelligence (AI). If set to false this creature becomes dumb and just stands around. It even won’t react to physical forces. Default is true.
The ‘health’ is the energy of this entity. When it falls to zero this entity dies.
This is the item this entity is holding in its main hand.
This is the item this entity is holding in his off hand.