getBulbType

getBulbType([number entity]) → integer type
Returns the bulb type of the given entity.

Returns the type of the bulb entity, as one of the BULB_* constants (for example BULB_PUNY, BULB_FIRE, BULB_HEALER...).

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 bulb, and null if no entity has that id.

Example:

var enemy = getNearestEnemy()
if (getBulbType(enemy) == BULB_FIRE) {
    debug("A fire bulb!")
}
const enemy = Fight.getNearestEnemy()
// `type` only exists on a Bulb: check the entity kind first.
if (enemy instanceof Bulb && enemy.type === Bulb.Type.FIRE) {
	Debug.log("A fire bulb!")
}
enemy = Fight.getNearestEnemy()
# `type` only exists on a Bulb: check the entity kind first.
if isinstance(enemy, Bulb) and enemy.type == Bulb.Type.FIRE:
	Debug.log("A fire bulb!")
Parameters
Return