rednode API - v0.1.0
    Preparing search index...

    Interface Player

    The player character, V.

    interface Player {
        getHealth(): Promise<number>;
        position(): Promise<Vector3>;
        setHealth(value: number): void;
    }
    Index
    • Reads the player's current health.

      Not built yet: arrives with the generic game API in overlay phase O6b. Throws until then.

      Returns Promise<number>

    • Reads V's position in the world.

      Rejects at the main menu and while a save loads, when there is no player.

      Returns Promise<Vector3>

      const { x, y, z } = await game.player.position();
      console.log(`V is at ${x.toFixed(1)}, ${y.toFixed(1)}, ${z.toFixed(1)}`);
    • Sets the player's health.

      Not built yet: arrives with the generic game API in overlay phase O6b. Throws until then.

      Parameters

      • value: number

        New health points.

      Returns void