Skip to content
⚠️The Decentraland API changed since this was made so it wont work. Please see
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

⚠️The Decentraland API changed since this was made so it wont work. Please see


This Decentraland scene demonstrates synchronization of state between networked users over websockets. The user should be able to connect and see other users interacting with the scene.

At this time Decentraland isn't rendering the avatars so imagine in this scene the "ghost cylinders" are like a force field around the players while they are in proximity to this scene.

  • See all users moving around the scene
  • Proximity activated tiles
  • Proximity activated door


How to do this

Two parts

The Decentraland Scene project is in ./scene.

The Server is in ./server.


Install Decentraland CLI app

git clone
cd sample-sync-websockets

# install scene packages
cd scene
npm install
npm start

# (in another terminal)
# install server packages
cd ../server
npm install
npm start

Windows users may require npm install --ignore-scripts to avoid compilation.

It's going to bind on two ports:

  • Decentraland preview server
  • Websocket server

Open the preview:


If you open it in multiple windows you can see the other players in the same scene.


The ./scene project has these npm scripts:

# just build and exit
npm run build

# build and watch for changes
npm run watch

# start the preview server which runs also `npm run watch`
npm start

The ./server project has the following npm scripts:

# watch for changes in development and re-run the server
npm run watch

# run the server in production
npm start

Each project contains a ./lib directory. It's possible to adjust some settings in the following files:


Publishing the scene on Decentraland

To to run the server in production you can cd server and npm start.

See also Host on Zeit Now


If you notice that I've made an affront to correct TypeScript coding practices please forgive.

Others will want to use this as an example or starting place to fork from. If you see room for improvement please fork, mod, and send back here in a PR.

Thank you! 🤗

You can’t perform that action at this time.