MobEntityHelper
com.jsmacrosce.jsmacros.client.api.helper.world.entity.MobEntityHelper
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
Methods
isAiDisabled
Returns whether the mob's no-AI flag is set.
Returns:
true if the entity's AI is disabled, false otherwise.isAttacking
Returns whether the mob's aggressive-state flag is set.
Returns:
true if the entity's aggressive flag is set, false otherwise.