Introducing Opal's GraalVM Scripting Engine

Write custom JavaScript that interacts with Opal's internal APIs. Automate tasks, react to game events, draw your own HUD, and extend the client at runtime.

FeaturesMarch 15, 2026by trq· Updated June 3, 2026

Opal ships a GraalVM JavaScript engine, a full JS runtime running inside the Minecraft client. You write scripts that talk to Opal's internal APIs while the game is live. This is not a macro recorder or a keybind system. It is a real programming environment with access to the client's event system, module configs, and game state.

Key takeaways
  • A full GraalVM JavaScript runtime, not a macro recorder.
  • React to game events, change module settings, and draw your own HUD.
  • Scripts load at runtime, no restart, and run sandboxed to Opal's APIs.
  • Most other clients stop at basic macros.

Why GraalVM

GraalVM is a polyglot runtime from Oracle. We picked it for concrete reasons:

  • Speed: JIT compilation keeps scripts fast enough to run every tick.
  • JavaScript: most people already know it, so the learning curve is short.
  • Thread safety: the JS-to-Java bindings handle concurrency properly instead of leaving you to trip over it.
  • Familiar patterns: standard JavaScript APIs behave the way you expect.

What you can build

Custom automation

Respond to in-game events:

// Auto-respond to certain chat messages
on('chat', (event) => {
  if (event.message.includes('1v1?')) {
    sendChat('/duel accept');
  }
});

Dynamic module configuration

Change module settings based on game state:

// Increase reach when health is low
on('tick', () => {
  const health = player.getHealth();
  if (health < 8) {
    modules.get('Reach').setSetting('distance', 3.3);
  } else {
    modules.get('Reach').setSetting('distance', 3.1);
  }
});

Custom HUD elements

Draw your own overlays:

// Display a combo counter on screen
let combo = 0;
on('attackEntity', () => { combo++; });
on('damage', () => { combo = 0; });
on('render2d', (ctx) => {
  ctx.drawText(`Combo: ${combo}`, 10, 10, 0xFFFFFF);
});

Server-specific profiles

Switch configs automatically when you join different servers:

on('serverJoin', (event) => {
  if (event.ip.includes('pvp.example.com')) {
    loadConfig('server-bypass');
  } else {
    loadConfig('ghost-default');
  }
});

Getting started

1

Open the scripts directory

Find the scripts directory in your Opal config folder.

2

Create a .js file

Any name works. This is your script.

3

Write against the API

Use the API reference in the dashboard docs: events, module access, player state, and rendering.

4

Save and play

Scripts load at runtime, so there is no restart.

Scripts run sandboxed

Scripts execute inside GraalVM and can call Opal's APIs, but they cannot touch your filesystem, network, or other apps. Your scripts stay local and your machine stays yours.

Community scripts

The scripting community is growing. The Discord has shared scripts and people to help you write your own. Common ones include auto-game scripts for minigames, stat trackers, combo detection, and server-specific config switchers.

FAQ

Get a client you can script, $8.99

Lifetime license · instant delivery · no subscription