authoritative-server

Build multiplayer Decentraland scenes with a headless server controlling authoritative game state.

Updated Sep 11, 2026
One-click install
npx skills add https://github.com/ansonj-dev/neon-reverse --skill authoritative-server-ansonj-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authoritative-server
Source: https://github.com/ansonj-dev/neon-reverse/tree/main/agent/skills/authoritative-server
Command: npx skills add https://github.com/ansonj-dev/neon-reverse --skill authoritative-server-ansonj-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dcl/sdk, @dcl/js-runtime, @dcl/asset-packs, and includes references (resource) components.

What problem does it solve? Standard Decentraland multiplayer relies on serverless CRDT sync, which means any client can write shared state, making cheating trivial and preventing server-side validation, persistent storage, or secret-keeping. This Skill guides the implementation of scenes where a headless server owns game state, validates every change, and blocks client tampering. ## Core Features & Use Cases - Server-authoritative state: Branch one codebase with isServer(), define synced components, and lock them with validateBeforeChange() so only the server can write. - Anti-cheat validation: Verify player actions server-side using real positions from PlayerIdentityData and Transform instead of trusting client-reported data. - Persistence and secrets: Use Storage for scene and per-player data that survives restarts, and EnvVar for server-only secrets and live-tunable parameters. - Use Case: Build a competitive leaderboard scene where clients send a claimPoint action, the server validates proximity to a score orb, increments the score itself, persists totals, and broadcasts a synced top-N board. ## Quick Start Ask the AI to convert your Decentraland scene to authoritative multiplayer by installing the @dcl/sdk@auth-server branch and adding server-side validation for all shared game state.

Frequently Asked Questions about authoritative-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an authoritative server to a Decentraland scene?

Install @dcl/sdk@auth-server and @dcl/js-runtime@auth-server instead of the standard SDK. The sdk-commands tooling auto-adds authoritativeMultiplayer: true to scene.json on every build and preview, which enables the headless server.

How do I prevent clients from modifying game state in Decentraland multiplayer?

Use validateBeforeChange() on synced components, guarded inside an isServer() block. The strictest pattern rejects any change whose senderAddress is not AUTH_SERVER_PEER_ID, so only the server can write state.

What is the difference between authoritative server and multiplayer-sync in Decentraland?

multiplayer-sync uses serverless CRDT where every client syncs its own entities with no validation. The authoritative server runs a headless server that owns state, validates changes, supports Storage and EnvVar, and only the server calls syncEntity().

Why does my Decentraland server scene not respond when the first player joins?

The server only runs while players are present and cold-starts in about 15 seconds in production. isStateSyncronized() does not indicate server readiness, so implement a heartbeat the server pulses into a synced component every ~2 seconds.

How do I persist player data across Decentraland server restarts?

Use Storage.player.set/get scoped by wallet address, or Storage.set for scene-wide data, imported from @dcl/sdk/server. Persist only at checkpoints like game over or player leave, and always check the returned boolean since capped writes resolve to false.

Why does syncEntity fail with id already in use on my Decentraland server?

This happens when an explicit sync id derived from a player address collides with another player or a stale entity. Omit the id so allocation is automatic, and store the player address in a component field for lookups instead.