Welcome to MCExtensions!

A fast, modern way to customize your Minecraft server — using just JavaScript. No Java. No compiling. No headache.

Never touched Java before? You're fine.
MCExtensions skips the plugin boilerplate so you can focus on actually building cool things.

Normally, writing Minecraft plugins means diving into Java, setting up a dev environment, compiling a `.jar`, restarting your server, and hoping it all works.
This isn't that.

✅ Just write a .js file and drop it in
✅ Use simple APIs like MCPlayer, MCPos, and more..
✅ Reload everything instantly with /extensions reload
✅ If something breaks, you'll get an error in chat — not a full crash

Whether you're making new commands, automating stuff, or tweaking gameplay — MCExtensions makes it easy to script your ideas in real time.

Getting Started

Whether you're a Minecraft server admin or someone who just wants to mess around with scripting — MCExtensions makes it easy to get started, even if you've never touched Java.

You won't need to install any developer tools or write Java code. If you've ever opened a text file and typed something, you're qualified. ✅

⚡ Quick Setup

Here's how to get things running in a few minutes:

  1. Make sure you're using Java 23 or newer
    MCExtensions won't run on anything older. This is a hard requirement — no Java 17, no Java 8.
    If you're not sure what version you're using, run: java -version
    For best results, we recommend installing GraalVM, which is a fast, JavaScript-friendly runtime that works great with MCExtensions.
  2. Drop in the plugin
    Download the latest .jar from the Download page and place it into your server's plugins/ folder.
  3. Start your server
    Boot it up like usual. MCExtensions will generate a scripts/ folder and a config.yml file automatically.
  4. (Optional) Enable the built-in editor
    Open plugins/MCExtensions/config.yml and set:
    editor: true
    This lets you write scripts directly from your browser — no extra tools needed.
  5. (Optional) Use /editor in-game
    Type /editor in the chat. It'll send you a clickable link to the web editor.
    ⚠️ This only works on local servers (your own machine). Hosted servers won't support this (yet).
⚠️ Do not use /reload in Minecraft — it breaks things. Use /extensions reload instead to safely reload your scripts.

🧪 Try a Script

Once setup's done, try one of these working examples to see how things work.

📁 Scripts live in plugins/MCExtensions/scripts/
🔄 Reload them with /extensions reload
🌐 Or use /editor to open the built-in browser editor

👋 Hello Command

A simple script that lets players run /. hello to get greeted in chat.

const ext = MCExt.registerExtension("hello", {
    description: "Says hi!"
});

ext.command({
    name: "hello",
    usage: "/. hello",
    description: "Greets the player.",
    execute({ player }) {
        player.sendMessage("Hello, " + player.getName() + "!");
    }
});

🎁 Starter Kit Command

Gives the player a stone pickaxe and axe — useful for pvp servers.

const { MCStack, MCResource } = include();

const ext = MCExt.registerExtension("starterKit", {
    description: "Adds Kits."
});

ext.command({
    name: "kit",
    description: "Gives basic tools.",
    usage: "/. kit",
    execute({ player }) {
        const inv = player.getInventory();
        inv.addItem(new MCStack(new MCResource("stone_pickaxe"), 1));
        inv.addItem(new MCStack(new MCResource("stone_axe"), 1));
        player.sendMessage("Kit delivered!");
    }
});

🧱 Place a Block

Places a glass block right under the player.

const { MCPos, MCResource } = include();

const ext = MCExt.registerExtension("blockDrop", {
    description: "An extension."
});

ext.command({
    name: "up",
    usage: "/. up",
    description: "Places a glass block below you.",
    execute({ player }) {
        const pos = player.getPosition();
        pos.y -= 1;
        ext.setBlock(pos, new MCResource("glass_block"));
    }
});

🚀 Knockback Launch

Launch the player upward — because why not?

const ext = MCExt.registerExtension("yeet", {
    description: "An extension."
});

ext.command({
    name: "yeet",
    usage: "/. yeet",
    description: "Launch yourself upward!",
    execute({ player }) {
        player.push(0, 10, 0);
        player.sendMessage("YEET!");
    }
});

🕛 Timer-based Action

Sends a server-wide message every few seconds. Great for announcements or automation.

const ext = MCExt.registerExtension("repeatMsg", {
    description: "An extension."
});

ext.callOnTimer({
    interval: 100, // every 5 seconds (20 ticks * 5)
    callback() {
        ext.sendServerMessage("This message repeats every 5 seconds.");
    }
});

Features

MCExtensions lets you write custom behavior for your Minecraft server using just JavaScript — no Java, no compiling, no restarting every five minutes.

You can build new commands, control players, mess with inventories, modify blocks, and run timed logic — all with a clean API and fast reloads.

✨ Write scripts using JavaScript, not Java
🔁 Reload scripts on the fly with /extensions reload
🧩 Define rich commands with argument types and tab suggestions
🧠 Access players, inventories, positions, and world data — all from your script

🔧 Built-in Commands

MCExtensions includes a few built-in commands to make managing your extensions easier:

  • /extensions – List all registered extensions and commands
  • /extensions reload – Reload all active scripts instantly
  • /extensions unload – Unload everything cleanly
  • /extensions <extension> <command> – Run a specific command manually
  • /. – Shortcut for running extension commands (auto-picks the first matching one)
  • /editor – Opens the link to the built-in code editor (if enabled)
💡 Example:
/extensions myExtension greet
or just:
/. greet

📝 Built-in Web Editor

Don't want to install VSCode or any other editor? No problem. MCExtensions comes with a browser-based editor you can open in one command — right from the server.

  • 📄 View and edit your scripts/ folder directly
  • 🧠 Built-in autocomplete using the MCExtensions API
  • 🔥 Optional hot-reload on save (when enabled)
  • 🌐 No install, no setup — just toggle it on and run /editor

To enable the editor, open config.yml and set:
editor: true
Then restart the server and run /editor in-game. It'll post a clickable link.

⚠️ The editor only works if your server is running on the same machine as your browser. Remote/hosted servers don't support it (yet).

💡 Tab Completion That Just Works

MCExtensions makes your commands smarter by showing suggestions based on argument types — right in the chat. So if your command expects a block, a boolean, or a number, it'll help players fill it in.

✅ Works out of the box with ext.command()
✅ Supports types like MCResource, boolean, int, etc.
✅ Makes your commands way more user-friendly

1. Block and Item Suggestions

If your command expects something like an item or block name, suggestions pop up automatically. Here's an example:

Paused
ext.command({
    name: "give",
    description: "Gives the player a specified item and amount.",
    usage: "/. give <item> <amount>",
    args: {
        item: "MCResource",
        amount: { type: "int", default: 1 }
    },
    execute({ player, args }) {
        const stack = new MCStack(args.item, args.amount);
        player.getInventory().addItem(stack);
        player.sendMessage(`Gave you ${args.amount} of ${args.item.getName().toLowerCase()}.`);
    }
});

2. Boolean Suggestions

Need a true/false toggle? Players get suggestions for both options automatically.

Paused
ext.command({
    name: "fly",
    description: "Toggles flight for the player.",
    usage: "/. fly <true|false>",
    args: {
        permission: "boolean"
    },
    execute({ player, args }) {
        player.setAllowedFlight(args.permission);
        player.sendMessage("Flight mode: " + args.permission);
    }
});

That's just the surface. You're not stuck writing config files or clicking through UI menus — you can build real logic, react to events, and create your own tools with just a few lines of JavaScript.

Whether you're scripting for fun, building admin tools, or automating your server — MCExtensions is built to get out of your way and let you create. Fast reloads, full control, and no Java required.

API Reference

Welcome to the API Documentation

This is the official reference for the MCExtensions JavaScript API — your toolkit for building real-time Minecraft server features using plain JavaScript.

Everything here is script-accessible. You'll find methods and classes to create commands, modify the world, talk to players, and much more — all without ever touching Java or restarting your server.

The sidebar on the left lists everything that's available. Click on any item to jump to its usage details and code examples.

💡 Tip: The built-in editor has autocomplete for all documented functions — no need to memorize anything.

MCExt

MCExt is the global object available in every script. It's your starting point for using MCExtensions.

You call MCExt.registerExtension() to define a new extension — think of it as a "module" where your custom commands and logic live. It returns an MCHandler, which you'll use to build your actual features.

📌 Every script starts with a call to MCExt.registerExtension(). No imports or setup needed.
⚠️ Extension names can only include letters, numbers, underscores (_), and hyphens (-).

Registering an Extension

const ext = MCExt.registerExtension("myExtension", {
    description: "My custom extension"
});

This sets up a new extension named myExtension. The ext you get back lets you define commands, log messages, schedule timers, and more — all from that one object.

toString()

console.log(MCExt.toString());
MCExt is built-in — you never need to import anything.
❗ It only has two functions: registerExtension() and toString().

MCHandler

MCHandler is what you get back from MCExt.registerExtension(). It's your main handle for working with your extension — you'll use it to register commands, log info, access metadata, schedule tasks, and interact with the world.

Here's what it gives you:

  • 🧩 Define custom commands using command()
  • 📋 Read or update your extension's metadata (name, description, etc.)
  • 🪵 Log messages to the server console with log(), warn(), and err()
  • 🕛 Schedule timers using callOnTimer() (repeat) or callAfterTime() (delay)
  • 🌍 Read and write blocks using getBlock() and setBlock()
⚠️ You can only register a command once per extension. Duplicate names will throw.

Define a Command

ext.command({
    name: "hello",
    description: "Sends a friendly greeting",
    usage: "/. hello",
    execute({ player }) {
        player.sendMessage("Hello!");
    }
});

Console Logging

ext.log("Hello from extension!");
ext.warn("Something may be wrong...");
ext.err("Something went wrong!", error);

Logging goes to the server console, not in-game chat. Pass multiple args like console.log.

Working with Metadata

const meta = ext.getMetaData();
ext.log("Extension name:", meta.getName());

meta.setDescription("Updated description");
ext.setMetaData(meta);

Automatic Cleanup

✅ All commands and timers are cleaned up when your extension is unloaded — no need to unregister manually.

MCPlayer

MCPlayer represents a currently connected player. It gives you full control over player-related logic — messaging, health, inventory, teleportation, flight, and more.

Sending Messages

player.sendMessage('Welcome!');
player.sendMessage('You have', player.getXpLevel(), 'XP levels.');

You can pass multiple values to sendMessage() — each one shows up as a separate message in the player's chat.

Teleporting

const pos = player.getPosition();
pos.y += 10;
player.setPosition(pos);

setPosition() moves the player instantly. It does not check for safety — it's on you to avoid suffocation or void deaths.

Push / Velocity

player.push(0, 1, 0); // Launches the player upward

push() adds velocity to the player, similar to knockback or a jump boost.

Health

player.setHealth(10);
ext.log('Current health:', player.getHealth());

Health is clamped between 0 and 20 (Minecraft's default max). Setting it to 0 kills the player.

Flight Permissions

player.setAllowedFlight(true);
ext.log('Flight enabled:', player.allowedFlight());

setAllowedFlight(true) enables flight for the player. It doesn't toggle whether they're flying, just whether they can.

Inventory

const inv = player.getInventory();
inv.clear();

Use getInventory() to access the player's inventory. See MCInventory for full control options.

MCInventory

MCInventory represents any inventory — typically from a MCPlayer. It lets you inspect, modify, and manage item contents: add stacks, set individual slots, or clear the whole thing.

Accessing Inventory

const inv = player.getInventory();

Call getInventory() on a player to get a valid MCInventory instance.

Clearing All Items

inv.clear();

Removes everything in the inventory.

Getting Items

const item = inv.getItem(0);

Gets the MCStack in the specified slot.

⚠️ Throws if the slot index is out of bounds.

Setting Items

inv.setItem(0, new MCStack(new MCResource('diamond'), 1));

Places a stack into the given slot.
use include() to be able to use MCStack and MCResource.

const { MCStack, MCResource } = include();
⚠️ Always check size() before using setItem().

Adding Items

const leftover = inv.addItem(new MCStack(new MCResource('stone'), 100));

Tries to insert a stack. Fills existing partials first, then empty slots. If there's not enough space, returns leftover items:

// Example output:
{
    36: MCStack { ... },
    37: MCStack { ... }
}

Inventory Size

ext.log('Inventory has', inv.size(), 'slots');

Use size() to get the number of available slots.

⚠️ Slot indices must be between 0 and size() - 1.

MCPos

MCPos is a simple coordinate object that represents a location in the world. It includes x, y, and z values, plus an optional world field.

Creating and Modifying Positions

const pos = new MCPos(10, 68, 143);
player.setPosition(pos);
const pos = player.getPosition();
pos.y += 5;
player.setPosition(pos);

Coordinates are doubles and editable. You can directly update the fields to move or shift a position.

Working with Worlds — MCWorld

pos.world = MCWorld.NETHER;

Set the world property to target a specific dimension. If not set, MCExtensions will infer a default (usually the player's current world or OVERWORLD).

MCPos is used across the API — including for teleporting, placing blocks, or comparing locations. It integrates seamlessly with MCPlayer, MCWorld, and more.

Formatted Output

ext.log(pos.getFormatString());

Returns a readable string with coordinates and world — useful for debugging or logs.

Example: Place a Block Below the Player

const blockPos = player.getPosition();
blockPos.y -= 1;
ext.setBlock(blockPos, new MCResource('stone'));

This places a block directly under the player using a MCPos.

MCWorld

MCWorld represents a specific dimension or world on the server. It's used alongside MCPos for positioning, or when you need to control world-level properties like time.

Predefined Worlds

pos.world = MCWorld.OVERWORLD;
pos.world = MCWorld.NETHER;
pos.world = MCWorld.END;

You can access the three default Minecraft dimensions using these constants: MCWorld.OVERWORLD, MCWorld.NETHER, and MCWorld.END.

Getting and Setting Time

const world = pos.world;
ext.log("Current world time:", world.getTime());

world.setTime(6000); // Noon

Time is measured in ticks — from 0 (sunrise) to 24000 (full day/night cycle). Use setTime() to instantly update time for everyone in that world.

Retrieving the World Name

ext.log("World name:", world.getName());

Returns the internal world name (e.g. "world", "world_nether"), matching your server folder structure.

✅ Time changes apply immediately to all players.
❗ Custom or modded dimensions aren't supported (yet).

MCStack

MCStack represents a stack of items. It combines a MCResource (the item type) with an amount. Use it to add, remove, or manipulate items in inventories.

Creating an Item Stack

const stack = new MCStack(new MCResource("stone"), 64);

You must provide both the MCResource and a positive integer for the amount. Passing a negative or missing amount will throw an error.

Working with Stacks

stack.setAmount(10);
stack.setResource(new MCResource("diamond_sword"));

ext.log("Amount:", stack.getAmount());
ext.log("Item name:", stack.getResource().getName());

You can update the item and quantity at any time. getAmount() returns the current amount, while getResource() gives you the resource object representing the item.

⚠️ If the provided resource isn't a valid item (e.g. block-only material), the MCStack constructor will throw an error.

Checking for Item Validity

const res = new MCResource("stone");
if (res.isItem()) {
    const stack = new MCStack(res, 32);
}

Use isItem() to confirm that a resource is valid before creating a stack from it.

MCStack supports all Minecraft items: tools, food, blocks, redstone, and more.
❗ There's no hard limit on stack size, but values above 64 might not behave as expected in-game.

MCResource

MCResource is how you reference any block or item in Minecraft — like "stone" or "minecraft:diamond_sword". It's used for anything involving inventory actions, block placement, or stack creation.

Creating a Resource

const res = new MCResource("stone");
const sword = new MCResource("minecraft:diamond_sword");

You can pass just the name ("stone") or the full namespaced ID ("minecraft:stone"). Either works.

⚠️ If the name doesn't match a valid Minecraft item or block, creating the resource will throw an error.

Getting the Resource Name

ext.log("ID:", res.getName().toLowerCase()); // stone

getName() returns the resource name in uppercase by default. Call toLowerCase() on it if you want it lowercased.

Checking Type

if (res.isItem()) {
    ext.log("This is a valid item");
}
if (res.isBlock()) {
    ext.log("This is a valid block");
}

Use isItem() to check if it's usable in inventories, or isBlock() for block placement. Useful for validating input before running commands.

MCResource is required for most item/block-related tasks: giving items, placing blocks, or creating MCStacks.
❗ Invalid names will fail instantly, so double-check them.

ExtensionMetaData

ExtensionMetaData stores your extension's display name and description. You can read or modify it at runtime to update how your script shows up in /extensions and other UIs.

Accessing Metadata

const meta = ext.getMetaData();

ext.log("Extension name:", meta.getName());
ext.log("Description:", meta.getDescription());

Call getMetaData() on your MCHandler instance to retrieve the current metadata.

Changing Metadata

meta.setName("coolerName");
meta.setDescription("This plugin just got renamed.");

You can change both values dynamically. Once updated, the new name and description take effect immediately — even in things like /extensions and tab suggestions.

✅ Metadata updates apply live — no reload required.
✅ Changing the name affects how your extension is identified in commands.
❗ Changes aren't saved across restarts. They'll reset to the values you passed into MCExt.registerExtension.

include()

include() is a global function that gives your script access to all the native MCExtensions types. It must be called at the top of any file that uses these classes.

const { MCPlayer, MCStack, MCPos } = include();

This gives you constructors for all the core building blocks used in commands, events, and gameplay logic.

  • MCPlayer — Represents a player
  • MCPos — A 3D position in the world
  • MCWorld — A reference to a specific world
  • MCResource — An item or block type
  • MCStack — A stack of items (item + count)
✅ Always returns the same shared reference (singleton)
✅ Use new to create instances (e.g. new MCStack(...))
❗ Required in every script where you want to use native classes — they're not globally available

Contact & Credits

Built with 💙 by goldenegg000 — powered by curiosity and redstone dust.

Whether you're a developer, server owner, Minecraft fan, or just curious — MCExtensions is designed to be fun, flexible, and beginner-friendly.

Have questions, suggestions, or found something weird? Want to share a cool script or just hang out? Drop in anytime — it's a great place to get help or just talk shop!

Join the official MCExtensions Discord Community!
Join MC-Extensions Hub on Discord!
Get help, share ideas, and connect with others building awesome things with MCExtensions!

Thanks for stopping by — more cool stuff is always on the way!

goldenegg000 / MCExtensions Team

MCExtensions Logo

Download MCExtensions

Ready to get started? Download the latest version of the MCExtensions plugin below and drop the .jar file into your server's plugins folder. That's it — you're up and running!
For a walkthrough on creating your first script, check out the Getting Started guide.

Latest Version: a1.0.0+mc1.20.1-SNAPSHOT ALPHA SNAPSHOT

📦 Download:
MCExtensions-a1.0.0+mc1.20.1-SNAPSHOT.jar

🕒 Released on: 23 April 2025, 21:20:35
⚠️ Heads up! This is an early alpha snapshot — things might break or change suddenly.
The JavaScript API is still evolving and features may be reworked or removed in upcoming versions.

💬 Have feedback, ideas, or ran into a bug? Let us know.