Class: Mob

Class contents

Methods list

These are special functions (or methods) that you may call on the object. these functions typically instruct the object to perform a certain operation.

Public properties list

Properties are attributes of the object, this directly affect the object in question. Some of them can be read or written, or both.
Name Type Description
id integer The unique ID of the mob
x float The x world position
y float The y world position
z float The z world position

Events list

Events are functions you add to your objects, that will be called by Cubiverse when certain things (events) occur.
    No events

Class Information

Constructor

new Mob()

You cannot instigate a mob directly from normal Java-script code, it can only be created from the spawnMob() event on a MobSpawnEntity object Also, check out the Wiki for more information on MobSpawnEntity
This:

Properties:

Name Type Description
id integer The unique ID of the mob
x float The x world position
y float The y world position
z float The z world position
Important:
  • You cannot instigate a mob directly from normal Java-script code, it can only be created from the spawnMob() event on a MobSpawnEntity object

Methods

followMode(mobFollowMode)

Sets the follow mode of the mob

Mobs can be set to chase, flee or be neutral to targets (targets are currently players, but I may support other mob's as targets later)

Parameters:
Name Type Description
mobFollowMode enum This specifies the type of follow mode the mob should perform:

mobFollowMode.chase - [DEFAULT] Mob's will actively chase the target

mobFollowMode.flee - Mob's will flee from targets, attempting to hide out of sight

mobFollowMode.neutral - Mob's will be indifferent to any targets

Example
myMob.followMode = mobFollowMode.chase ;

followStrength(mobFollowStrength)

Sets the strength of the follow mode

Regardless of what mode (chase, flee, etc.) you can specify how actively (or agressively) the mob will attempt to chase or flee any available targets.

Parameters:
Name Type Description
mobFollowStrength enum This specifies the strength of follow mode:

mobFollowStrength.low - Mob will only occasionally be interested in target if its close enough (to chase or flee from)

mobFollowStrength.medium - Mob's will track targets, but will flick between targets easily

mobFollowStrength.high - [DEFAULT] Mob's will be focus on a target, and generally attempt to chase/flee it quickly

mobFollowStrength.insane - Mob's will be solely locked on a target, and continue until it's attacked or ran away

Example
myMob.followStrength = mobFollowStrength.medium ;