Wizards of Lua

The Art of Spell Crafting


Mob - Mobile Creatures

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

Properties

Below you find short descriptions about each of the properties and some examples about how to use them in your spells.


ai : boolean

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.


health : number (float)

The ‘health’ is the energy of this entity. When it falls to zero this entity dies.


mainhand : Item

This is the item this entity is holding in its main hand.


offhand : Item

This is the item this entity is holding in his off hand.