Object used to register entity AI prototypes.

interface EntityAIPrototype {
    data?: object;
    params?: object;
    attackedBy?(attacker: number): void;
    death?(attacker: number): void;
    execute?(): void;
    executionEnded?(): void;
    executionPaused?(): void;
    executionResumed?(): void;
    executionStarted?(extra?: any): void;
    getDefaultName?(): string;
    getDefaultPriority?(): number;
    hurtBy?(attacker: number, damage: number): void;
    projectileHit?(projectile: number): void;
}

Hierarchy (view full)

Implemented by

Methods

  • Called when entity is attacked by player.

    Parameters

    • attacker: number

      player that attacked this entity

    Returns void

  • Called when entity is dead.

    Parameters

    • attacker: number

      entity that damaged this entity, or -1 if damage source is not an entity

    Returns void

  • Defines main logic of the AI type.

    Returns void

  • Called when AI type execution ends.

    Returns void

  • Called when AI type execution is paused.

    Returns void

  • Called when AI type execution is resumed.

    Returns void

  • Returns string

    AI type's default name.

  • Returns number

    AI type's default priority.

  • Called when entity gets hurt.

    Parameters

    • attacker: number

      entity that damaged this entity, or -1 if damage source is not an entity

    • damage: number

      amount of damage

    Returns void

  • Called when a projectile hits the entity.

    Parameters

    • projectile: number

      projectile entity ID

    Returns void

Properties

data?: object

Object containing the state of the AI type.

params?: object

Default parameters set.

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.