Introduction
Build Minecraft plugins with TypeScript using EcmaCraft
EcmaCraft is a TypeScript-first toolchain for creating Paper/Spigot plugins.
It combines:
- a Java host plugin runtime,
- generated Spigot types for editor support,
- a CLI for local development and production builds.
Documentation
Suggested Reading Order
- Start with Getting Started
- Read CLI Reference
- Configure local server behavior in Configuration
The configuration guide includes development.serverProperties, which lets you control seed,
online/offline mode, ports, and other server.properties values from TypeScript config.
Quick Example
import { type PluginContext, Event, type SpigotEventType } from 'ecmacraft';
class LightningStriker {
@Event('PlayerToggleSneakEvent')
onSneak(event: SpigotEventType<'PlayerToggleSneakEvent'>) {
if (!event.isSneaking()) return;
const player = event.getPlayer();
player.getWorld().strikeLightning(player.getLocation());
}
}
export default function main(ctx: PluginContext) {
ctx.registerHandlers(new LightningStriker());
}