Skip to main content

GameVars

Verification boundary

This page describes the committed source behavior. It omits certifying revision-sensitive RuneLite UI, packet, or in-game outcomes; treat those as live-client verification pending unless the page records direct evidence.

GameVars (com.n3plugins.sdk.client) reads client varbits and varplayer values without Api dependencies.

Methods:

  • GameVars.getVarbit(int varbitId) - reads a varbit. It returns 0 when the client reads null.
  • GameVars.getVarPlayer(int varPlayerId) - reads a varplayer. It returns 0 when the client reads null.
  • GameVars.getVarPlayerBit(int varPlayerId, int bitIndex) - reads a single packed bit from a varplayer value. It returns false when the client reads null.

Example:

// Quest stage stored in a varbit
int stage = GameVars.getVarbit(7334);

// Packed config flag in a varplayer
boolean autoRetaliate = GameVars.getVarPlayerBit(1, 0);

GameVars bypasses GameStateGuard and any Api class. It sits entirely within sdk.client and requires only a non-null N3Client.getClient(). Use it when you need raw game state omitted by a named action class.

For named varbits, prefer net.runelite.api.Varbits constants as the int argument. For named varplayers, use net.runelite.api.VarPlayer.