Installation
Set up your HytaleJS development environment
Server Setup
Download HytaleJS
Download the latest HytaleJS.jar from the releases page.
Install the plugin
Copy HytaleJS.jar to your Hytale server's mods folder:
hytale-server/mods/HytaleJS.jarStart your server
The plugin will create a scripts folder at:
hytale-server/mods/bmstefanski_HytaleJS/scripts/All .js files in the scripts folder are automatically loaded when the server starts.
Development Setup
To write plugins in TypeScript with type checking and autocompletion:
Prerequisites
- Node.js 18+
Setup
Create a new project
mkdir my-plugin && cd my-plugin
npm init -yInstall dependencies
pnpm add @hytalejs.com/core
pnpm add -D typescript esbuildnpm install @hytalejs.com/core
npm install -D typescript esbuildbun add @hytalejs.com/core
bun add -D typescript esbuildCreate tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"experimentalDecorators": true,
"types": ["@hytalejs.com/core"]
},
"include": ["src"]
}Add build script to package.json
{
"scripts": {
"build": "esbuild src/main.ts --bundle --format=esm --target=es2022 --outfile=dist/plugin.js"
}
}Project Structure
my-plugin/
├── src/
│ └── main.ts # Your plugin code
├── dist/
│ └── plugin.js # Built output (deploy this)
├── package.json
└── tsconfig.jsonDeploying
Copy your built dist/plugin.js to the HytaleJS scripts folder:
hytale-server/mods/bmstefanski_HytaleJS/scripts/plugin.jsRestart your server to load the plugin.