This mod requires the installation of additional content using SMF.
- Download SMF if you don't have it already and set it up.
- Copy the Smf folder and its contents into your SMF
Mods
folder. - Rename the
Smf
folder you copied toEditor
(or anything else). - Run SMF, enable the
Editor
mod, andApply
your changes.
Third party tools can remotely control and communicate with a running editor
instance by connecting to a WebSocket server that the editor hosts locally on
port 46735
. The editor will only accept connections from localhost
(i.e.
the same machine that the editor is running on).
Clients can send JSON messages to the editor server, and the server will send
JSON events back to the client. After initial connection, the client must send
a Hello
message to the server, and the server will respond with a Welcome
event. After this handshake, the client can start controlling the editor and
receiving events from it (e.g. when entities get selected, their properties change,
etc.).
For a detailed description of all request and event types, see the editor.d.ts
file in this mod's folder. The EditorRequest
type describes all the requests
that a client can send to the editor, and the EditorEvent
type describes all
the events that the editor can send to a client.
You can also find a sample client implementation in the editor-client.ts file in this mod's folder. This file is written in TypeScript for use with Deno, but it can be used for reference when writing clients in other languages or environments.
Multiple clients can connect to the editor at the same time, and the editor will
send events to all connected clients. However, events that are tied to a request
that a specific client sent (e.g. a ListEntities
request) will only be sent to
that client.