Skip to content

Getting Started

Prerequisites

Before you begin, make sure you have the following installed:

Create a New Mod

The fastest way to start is the CLI scaffolding tool:

bash
npm create hackhub-mod

This sets up a complete mod project with TypeScript, build config, and templates.

Manual Setup

If you prefer to set things up yourself:

bash
npm install @hotbunny/hackhub-content-sdk --save-dev

Project Structure

A typical mod project looks like this:

my-mod/
├── src/
│   └── index.ts          # Mod entry point
├── dist/                  # Build output
├── manifest.json          # Mod metadata
├── esbuild.config.ts      # Build configuration
├── package.json
└── tsconfig.json

Mod Entry Point

Every mod needs a Bootstrap class decorated with @RegisterModPackage:

typescript
import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";

@RegisterModPackage
export default class MyMod extends Bootstrap {

    OnModPackageLoaded() {
        console.log("Mod loaded!");
    }

    OnModPackageUnloaded() {
        console.log("Mod unloaded");
    }

}

Lifecycle Hooks

HookWhen it's called
OnModPackageLoaded()After the mod and all its content are loaded
OnModPackageUnloaded()When the mod is disabled or unloaded

Manifest

Every mod requires a manifest.json in its root directory. See the Manifest Reference for the full schema.

json
{
    "id": "my-first-mod",
    "name": "My First Mod",
    "version": "1.0.0",
    "author": "Your Name",
    "description": "My first HackHub mod",
    "apiVersion": 1,
    "permissions": ["events"]
}

Building

Run the build command to compile your mod:

bash
npm run build

This produces a dist/ folder containing mod.js and your assets. The game loads mods from the mods/ folder in the game directory.

Next Steps

HotBunny Interactive Entertainment Inc.