Skip to content

MobEntityHelper ​

com.jsmacrosce.jsmacros.client.api.helper.world.entity.MobEntityHelper

Since1.8.4

Wraps a Minecraft mob and exposes its mob-specific state.

js
const mobs = World.getEntities("zombie", "skeleton", "creeper");  
if (mobs !== null) {
  for (const entity of mobs) {
    if (!(entity instanceof EntityHelpers.Mob)) continue;  
    if (entity.isAiDisabled()) {
      Chat.log(`a ${entity.getType()} near ${entity.getPos()} has no AI and is not going anywhere`);  
    }
  }
}

Available in scripts as EntityHelpers.Mob.

Type Parameters ​

  • T: the Minecraft mob type wrapped by this helper

Constructors ​

new MobEntityHelper ​

new MobEntityHelper(T extends Mob base)#
Wraps the supplied mob and retains its reference for this helper.

Parameters:

  • base: mob to wrap

Methods ​

isAiDisabled ​

isAiDisabled(): booleanSince1.8.4#
Returns whether the mob's no-AI flag is set.
Returns: true if the entity's AI is disabled, false otherwise.

isAttacking ​

isAttacking(): booleanSince1.8.4#
Returns whether the mob's aggressive-state flag is set.
Returns: true if the entity's aggressive flag is set, false otherwise.