HytaleJS

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.jar

Start 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 -y

Install dependencies

pnpm add @hytalejs.com/core
pnpm add -D typescript esbuild
npm install @hytalejs.com/core
npm install -D typescript esbuild
bun add @hytalejs.com/core
bun add -D typescript esbuild

Create 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.json

Deploying

Copy your built dist/plugin.js to the HytaleJS scripts folder:

hytale-server/mods/bmstefanski_HytaleJS/scripts/plugin.js

Restart your server to load the plugin.

Next Steps

On this page