New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

minecraft-core

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minecraft-core

Core library for Minecraft-related utilities

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Minecraft Server Manager

A powerful, environment-agnostic TypeScript library for managing, searching, and downloading various Minecraft server cores. Built with modern web standards and designed to work seamlessly in Node.js, Bun, and other JavaScript runtimes.

🚀 Features

  • Multi-Provider Support: Unified API to interact with major Minecraft server providers.
  • Environment Agnostic: Uses a FileSystemAdapter pattern, making it compatible with Node.js, Bun, and potentially Deno or browsers (with appropriate adapters).
  • Type-Safe: Built with TypeScript and Zod for robust runtime validation.
  • Hash Verification: Automatically verifies downloaded artifacts (SHA256, MD5, SHA1) when available.
  • Flexible: Supports downloading binaries, installers, or fetching download paths depending on the provider.

📦 Installation

npm install minecraft-core
# or
bun add minecraft-core
# or
pnpm add minecraft-core

🛠️ Supported Providers

ProviderKeyStatusDescription
Paperpaper✅ ReadyHigh performance Spigot fork.
Purpurpurpur✅ ReadyDrop-in replacement for Paper with more features.
Vanillavanilla✅ ReadyOfficial Minecraft server software from Mojang.
Fabricfabric✅ ReadyLightweight, modular modding toolchain (downloads Launcher JAR).
Forgeforge✅ ReadyMassive modding API (downloads Installer JAR).
Mohistmohist✅ ReadyHybrid server (Forge + Spigot/Paper).
Velocityvelocity✅ ReadyThe modern, high-performance Minecraft proxy.
Foliafolia✅ ReadyRegionized multithreading dedicated server.
Waterfallwaterfall✅ ReadyThe BungeeCord fork by PaperMC.
Arclightarclight✅ ReadyHybrid server (Forge + Spigot/Paper).
Magmamagma🚧 PlannedHybrid server (Forge + Spigot/Paper).

📖 Usage

1. Initialization

You must provide a FileSystemAdapter. A NodeAdapter is provided out-of-the-box which works for Node.js and Bun.

import { MinecraftServerManager, NodeAdapter } from 'minecraft-core';

// Initialize with the Node.js/Bun adapter
const manager = new MinecraftServerManager(new NodeAdapter());

2. Fetching Versions

Get a list of available Minecraft versions for a specific core.

const versions = await manager.getVersions('paper');
console.log(versions); // ['1.8.8', ..., '1.20.4', '1.21']

3. Downloading a Server

Download the latest build for a specific version.

try {
    const result = await manager.downloadServer({
        core: 'paper',
        version: '1.21',
        outputDir: './server',
        filename: 'server.jar' // Optional
    });

    console.log(`Downloaded to: ${result.path}`);
    console.log(`Hash: ${result.hash}`);
} catch (error) {
    console.error('Download failed:', error);
}

download avaible

4. Advanced: Get Build Details

If you need specific build information before downloading.

const build = await manager.getLatestBuild('purpur', '1.20.4');

console.log(`Build ID: ${build.buildId}`);
console.log(`Timestamp: ${build.timestamp}`);
console.log(`Download URL: ${build.downloads.application.url}`);

🧩 Adapters

This library uses the Adapter Pattern to handle file system operations. This allows you to use the library in environments where fs might not be available or behaves differently.

Custom Adapter

Implement the FileSystemAdapter interface to create your own adapter:

import type { FileSystemAdapter } from 'minecraft-core';

class MyCustomAdapter implements FileSystemAdapter {
    join(...paths: string[]): string { /* ... */ }
    mkdir(path: string): Promise<void> { /* ... */ }
    writeStream(path: string, stream: any): Promise<void> { /* ... */ }
    // ... implement other methods
}

const manager = new MinecraftServerManager(new MyCustomAdapter());

🧪 Testing

The project includes a comprehensive test suite using bun test.

# Run all tests
bun test

# Run type checking
bun run typecheck

📄 License

MIT

Keywords

minecraft

FAQs

Package last updated on 20 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts