> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overlayed.gg/llms.txt
> Use this file to discover all available pages before exploring further.

> All of the game events emitted by Teamfight Tactics.

# Teamfight Tactics

<Info>`overlayed.tft.readyForGameEvents()` must be called before any events will be emitted.</Info>

### live\_client\_data

<CodeGroup>
  ```ts type.ts theme={null}
  interface LiveClientDataEvent {
  	port: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"port": 2999
  }
  ```
</CodeGroup>

### match\_started

<CodeGroup>
  ```ts type.ts theme={null}
  interface MatchStartedEvent {
  	matchId: string;
  	gameMode: string;
  	mapNumber: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"matchId": "5412312873",
  	"gameMode": "TFT",
  	"mapNumber": 22
  }
  ```
</CodeGroup>

### match\_ended

<CodeGroup>
  ```ts type.ts theme={null}
  interface MatchEndedEvent {
  }
  ```

  ```json example.json theme={null}
  {}
  ```
</CodeGroup>

### player\_joined

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerJoinedEvent {
  	playerId: number;
  	summonerName: `${string}#${string}`;
  	skinId: string;
  	isBot: boolean;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"summonerName": "johndoe#1234",
  	"skinId": "0",
  	"isBot": false
  }
  ```
</CodeGroup>

### player\_left

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerLeftEvent {
  	playerId: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1
  }
  ```
</CodeGroup>

### stage\_changed

<CodeGroup>
  ```ts type.ts theme={null}
  interface StageChangedEvent {
  	stage: `${number}-${number}`;
  	name: "PVP" | "PVE" | "Carousel";
  	type: "PVP" | "Minions_1" | "Minions_2" | "Minions_3" | "Carousel" | "Augment_1" | "Augment_2";
  	nativeName:
  		| "Encounter_Group"
  		| "Intro1"
  		| "Intro2"
  		| "Intro3"
  		| "Combat"
  		| "Carousel"
  		| "Krugs"
  		| "Wolves"
  		| "Combat_Set6_Standard_AugmentEarly"
  		| "Combat_Set6_Standard_AugmentMid"
  		| "Combat_Set6_Standard_AugmentLate";
  }
  ```

  ```json example.json theme={null}
  {
  	"stage": "1-1",
  	"name": "PVE",
  	"type": "PVE",
  	"nativeName": "Carousel"
  }
  ```
</CodeGroup>

### battle\_start

<CodeGroup>
  ```ts type.ts theme={null}
  interface BattleStartEvent {
  	playerId: number;
  	// null when against AI
  	opponentId: number | null;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"opponentId": 2
  }
  ```
</CodeGroup>

### battle\_end

<CodeGroup>
  ```ts type.ts theme={null}
  interface BattleEndEvent {
  	playerId: number;
  	outcome: "victory" | "defeat";
  	streak: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"outcome": "victory",
  	"streak": -2
  }
  ```
</CodeGroup>

### unit\_damage\_changed

Only provided for local player.

<CodeGroup>
  ```ts type.ts theme={null}
  interface UnitDamageChangedEvent {
  	unit: number;
  	name: string;
  	damage: number;
  	physicalDamage: number;
  	magicDamage: number;
  	trueDamage: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"unit": 1,
  	"name": "Aatrox",
  	"damage": 100,
  	"physicalDamage": 100,
  	"magicDamage": 0,
  	"trueDamage": 0
  }
  ```
</CodeGroup>

### unit\_level\_changed

<CodeGroup>
  ```ts type.ts theme={null}
  interface UnitLevelChangedEvent {
  	unit: number;
  	name: string;
  	level: number;
  }
  ```

  ```json example.json theme={null}
  {}
  ```
</CodeGroup>

### player\_gold\_changed

Only provided for local player.

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerGoldChangedEvent {
  	playerId: number;
  	gold: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"gold": 100
  }
  ```
</CodeGroup>

### player\_died

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerDiedEvent {
  	playerId: number;
  	instigatorPlayerId: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"instigatorPlayerId": 2
  }
  ```
</CodeGroup>

### player\_level\_changed

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerLevelChangedEvent {
  	playerId: number;
  	level: number;
  	nextLevelXpRequired: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"level": 1,
  	"nextLevelXpRequired": 100
  }
  ```
</CodeGroup>

### player\_xp\_changed

Only provided for local player.

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerXpChangedEvent {
  	playerId: number;
  	xp: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"xp": 100
  }
  ```
</CodeGroup>

### player\_health\_changed

<CodeGroup>
  ```ts type.ts theme={null}
  interface PlayerHealthChangedEvent {
  	playerId: number;
  	health: number;
  }
  ```

  ```json example.json theme={null}
  {
  	"playerId": 1,
  	"health": 100
  }
  ```
</CodeGroup>

## Planned Additions

* item\_added
* item\_used
* shop\_changed
* bench\_update
* unit\_item\_changed
* unit\_position\_changed
