Entities
Varion exposes server-authoritative players and world entities through the SDKs. The server creates and owns network entities; client scripts receive streamed snapshots and can run local visual/native operations where allowed.
Server Entity Types
| Type | Server creation/API |
|---|---|
| Player | Created by connection pipeline; exposed as IPlayer |
| Vehicle | varion.CreateVehicle, varion.CreateVehicleEntity |
| Ped | varion.CreatePed, varion.CreatePedEntity |
| Object | varion.CreateObject, varion.CreateObjectEntity |
| Virtual entity | varion.CreateVirtualEntityGroup, varion.CreateVirtualEntity |
| Colshape | varion.CreateColShapeSphere, Box, Cylinder, Circle, Rectangle, Polygon |
| Checkpoint | varion.CreateCheckpoint |
| Blip | varion.CreateBlip, CreateBlipRadius, CreateBlipArea |
| Marker | varion.CreateMarker |
| Text label | varion.CreateTextLabel |
| Voice channel | varion.CreateVoiceChannel |
C# Player Surface
IPlayer includes connection data, lifecycle, health, armor, model, appearance, weapons, vehicle seat control, events, date/time, weather, streaming checks and data/meta storage.
Common methods:
player.Spawn(new Vector3(215.76f, -810.12f, 30.73f));
player.Kick("reason");
player.GiveWeapon(0x1B06D571, 100, true);
player.Emit("hud:show", true);
player.SetWeather(WeatherType.Clear);Server World Creation
var vehicle = varion.CreateVehicleEntity(
"adder",
new Vector3(220, -805, 30),
new Vector3(0, 0, 0));
var label = varion.CreateTextLabel(
"Garage",
new Vector3(220, -805, 31),
scale: 1.0f);Server JS (JavaScript)
In a server JS resource, varion.createVehicle, varion.createPed and varion.createObject are asynchronous and return a Promise: the server allocates the network id, so await the Promise to get the entity proxy.
const car = await varion.createVehicle(varion.hash('adder'),
{ x: 220, y: -805, z: 30 });
car.setStreamSyncedMeta('plate', 'VARION');The complete server JS API (entities, world visuals, colshapes, voice, metadata, timers) is Server JavaScript API.
Virtual Entities
Virtual entities are server-side objects without a GTA handle. They are streamed by group distance and can carry synced or stream-synced metadata.
var group = varion.CreateVirtualEntityGroup(400, 128);
var marker = varion.CreateVirtualEntity(new Vector3(100, 100, 30), group.Id);
marker.SetStreamSyncedMetaData("label", "pickup");Client Entity Snapshots
Client JavaScript exposes:
const local = varion.Player.local;
const players = varion.Player.all;
const streamedVehicles = varion.Vehicle.streamedIn;
const entity = varion.Entity.getByScriptID(scriptId);Client entity wrappers expose IDs, script IDs, model data, position/rotation snapshots, validity and local helper methods such as visibility, alpha, attachment, collision and freeze operations. Remote player transforms are server-authoritative.
Source Backing
This page is derived from sdk/Varion.SDK/varion.cs, sdk/Varion.SDK/IPlayer.cs, sdk/Varion.SDK/Vehicle.cs, sdk/Varion.SDK/ServerEntity.cs, sdk/Varion.SDK/VirtualEntity.cs, sdk/server-js-host/varion-entities.cjs and sdk/client-js-runtime/injected/entities-bootstrap.js.