Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fumo:game

fumo:game returns copied, immutable data. Safe scripts never receive entity, controller, scene-node, or bone pointers.

import { game } from "fumo:game";

const state = game.snapshot();
if (state.inGame) {
    for (const player of state.players) {
        console.log(player.id, player.name, player.health, player.origin);
    }
}

Methods:

  • game.snapshot() returns the full current snapshot.
  • game.players() returns the player array.
  • game.localPlayer() returns copied local team/origin data or null.

Player fields currently include:

id, generation, index, name, team, health, armor, distance,
enemy, visible, flashed, scoped, defusing, hasBomb, origin

The generation increments when the map or in-game state changes. An id combines that generation with the entity index, so a script can reject cached references after transitions.

The current player list is sourced from Fumoware’s validated visual snapshot. It contains players that reached that snapshot during the latest render data build; it is not a raw full entity-system iterator.