Make sure you installed the server and client before proceeding.
/client-packages/ /packages/ config.json Server(.exe)
client-packages/: in this directory, you can put client-only packages. See the Package Structure below for more information.
packages/: server packages. they can include a
client_packageinside (see below).
config.json: the main configuration file for the Server
Server(.exe): the server binary
Both the Server and Client make use of Packages. Simply put, a Package is an isolated module of your gamemode. This makes it easy to use third-party modules (like a chat, for example) to be added to your server, requiring you to only drop the package in.
freeroam package at first (it ships with the Server download).
You can find a bare package ready to use here: https://gitlab.nanos.io/jc3mp-packages/bare-minimum.
Each Package has to follow the structure below:
package.json: your Package configuration file. This file should be npm conform. See the package.json documentation for more detailed information.
main.js: while you can use a different entry point, the default start file for a package is always
main.js. this is where you write your own script.
for easier management of client and server packages, you can embed a Client Package into your Server Package. Just create a folder
inside your Server Package named
client_package with the structure mentioned above.
Make Sure that the
name property in your
package.json(server and clientside) match up! Otherwise the client package will not work.
The server does currently not hot-reload packages. This means that you have to restart either the Server or the Package when you modify it.
When you modify your client package, you must reload it, otherwise new connections to the server will fail.
You can restart a package using the
restart_package command in the server console.
This will restart the Package named
chat. Check the following output for errors.