getMobType([number entity]) → integer type
Returns the type of the mob entity, as one of the MOB_* constants (for example MOB_FENNEL_KING, MOB_EVIL_PUMPKIN, MOB_GRAAL...).
If entity is not given, the type of the current entity is returned. The function returns -1 if the entity exists but is not a mob, and null if no entity has that id.
Example:
var enemy = getNearestEnemy()
if (getMobType(enemy) == MOB_FENNEL_KING) {
debug("It's the Fennel King!")
}
const enemy = Fight.getNearestEnemy()
// `type` only exists on a Mob: check the entity kind first.
if (enemy instanceof Mob && enemy.type === Mob.Type.FENNEL_KING) {
Debug.log("It's the Fennel King!")
}
enemy = Fight.getNearestEnemy()
# `type` only exists on a Mob: check the entity kind first.
if isinstance(enemy, Mob) and enemy.type == Mob.Type.FENNEL_KING:
Debug.log("It's the Fennel King!")
MOB_* constant), -1 if the entity is not a mob, or null if the entity does not exist.Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.