Skip to content

@opys/minecraft ​

npm

Every Minecraft plugin for opys in one import. It has no code of its own: it re-exports the packages below.

sh
npm install -g @opys/cli
npm install -D @opys/dev @opys/minecraft

Example ​

js
// opys.config.mjs
import { defineConfig, userDataDir } from '@opys/dev';
import { forge, java } from '@opys/minecraft';

export default defineConfig({
  output: 'game.opys',
  plugins: [forge({ version: '1.20.1' }), java({ version: '17' })],
  manifest: {
    command: '@forge.command',
    args: ['@forge.jvmArgs', '@forge.mainClass', '@forge.gameArgs'],
    workdir: '${game_directory}',
  },
  run: (manifest) => ({
    manifest: {
      vars: {
        ...manifest.vars,
        root: userDataDir('my-pack'),
        username: 'Player',
        uuid: '00000000-0000-0000-0000-000000000001',
        token: '0',
      },
    },
  }),
});

Then opys launch.

What is in it ​

The game ​

Pick one. Each brings the game, its libraries and its command line.

PluginWhat it installsPackage
minecraftThe game with no mod loader.@opys/minecraft-vanilla
forgeForge.@opys/forge
neoforgeNeoForge.@opys/neoforge
fabricFabric.@opys/fabric
cleanroomCleanroom: 1.12.2 on a modern Java.@opys/cleanroom
lwjgl3ifylwjgl3ify: 1.7.10 on a modern Java.@opys/lwjgl3ify

Java ​

PluginWhat it installsPackage
javaA JDK, so players need none installed.@opys/java
dgpujA shim that picks the dedicated GPU.@opys/dgpuj

Mods and other files ​

PluginWhat it installsPackage
resourcesMods, packs and plugins from one TOML file.@opys/minecraft-resources
modrinthFiles from Modrinth, by version.@opys/modrinth
modrinthModpackA whole Modrinth modpack, loader included.@opys/modrinth
curseforgeFiles from CurseForge, by file.@opys/curseforge
curseforgeModpackA whole CurseForge modpack, loader included.@opys/curseforge
linksAny file you have a link to.@opys/links

files, for a folder on your disk, is in @opys/dev.

Accounts and servers ​

ExportWhat it doesPackage
authlibertyPoints the game at your own auth servers.@opys/authliberty
bifrostSigns a login token. A function, used in run.@opys/bifrost
serverlistFills the multiplayer server list.@opys/minecraft-serverlist
serverA Minecraft server, for a server pack.@opys/minecraft-server

One import or several ​

Both work, and they are the same code.

js
import { forge, java, modrinth } from '@opys/minecraft';
js
import { forge } from '@opys/forge';
import { java } from '@opys/java';
import { modrinth } from '@opys/modrinth';

Two names differ here from the packages they come from:

HereIn its own package
bifrostresolveBifrost in @opys/bifrost. Both names work here.
DEFAULT_PLATFORMSHere it is @opys/java's. @opys/dgpuj has one of its own.

Every plugin ​

Each plugin, as it is most often written. Every option is in the plugin's own README.

js
// the game: one of
minecraft({ version: '1.21.1' });
forge({ version: '1.20.1' });
neoforge({ version: '1.21.1' });
fabric({ version: '1.21.1' });
cleanroom({ version: '1.12.2' });
lwjgl3ify({ version: '1.7.10' });

// java
java({ version: '21' });
dgpuj();

// mods and other files
modrinth({ versions: ['Xbc0uyRg'], to: (file) => '${game_directory}/mods/' + file.filename });
curseforge({ files: [4835191], to: (file) => '${game_directory}/mods/' + file.filename, token });
links({ links: ['https://github.com/owner/repo/releases/download/v1.0/mod.jar'], to: (file) => '${game_directory}/mods/' + file.filename });
modrinthModpack({ pack: 'xVcA1pSL' });
curseforgeModpack({ file: 1040985, token });

// accounts and servers
authliberty({ version: 'latest', hosts: { auth: 'https://auth.example.com' } });
serverlist({ servers: [{ name: 'My server', ip: 'play.example.com' }] });
bifrost({ privateKey, username: 'Player', uuid: '00000000-0000-0000-0000-000000000001' }); // in `run`

Documentation ​

Part of opys.