From RAGE Multiplayer Wiki

This Function is used to alert client-side with entity's data change for a specified variable

Client-Side Function

 C#  JavaScript

C# Syntax

RAGE.Events.AddDataHandler(string name, OnEntityDataChangeDelegate handler);

JavaScript Syntax, handlerFunction);


  • key: String - Shared data key's name.
  • handlerFunction: Handler function with parameters:
    • entity: Entity - The entity that had the data change.
    • value: Any - The new value of the data key.
    • oldValue: Any - The old value of the data key.


    Handles testVar change.
    Do " = 1234;" on server-side to trigger this.
*/"testVar", (entity, value, oldValue) => {`testVar changed to ${value} on entity ${entity.handle}.`);


This example sets nickname for player and triggers players' clientside data handler

Server-Side'setNick', (player, nickname) => {
  player.setVariable('oldNick',; = nickname;
  player.setVariable('newNick', nickname);

Client-Side'newNick', function (entity, value, oldValue) {
  if (entity.type === 'player')`${player.getVariable('oldNick')} has changed nickname to ${value}`)

See Also