npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simplified-mojang-api

v0.0.22

Published

About Public repository to simplify the event logic of Mojang's Script API, for informal or professional use

Readme

🛠️ Simplified Mojang API

[!WARNING] ⚠️ WORK IN PROGRESS! ⚠️ This repository is constantly evolving and undergoing active updates, so some features or simplified methods may be missing or not yet implemented. Please keep this in mind when using it!

A simple tool that makes it easier to use the Mojang scripting API for Minecraft Bedrock, by providing pre-built and simplified classes.

What is this?

It's an informal or professional repository designed to simplify the logic of the native @minecraft/server module by integrating various pre-built classes and methods to save time and reduce code, as well as tools I've customized myself for use in any add-on.

Install:

Just run this in your terminal:

npm install simplified-mojang-api

(Make sure you also have the base @minecraft/server stuff installed!)

Build Setup:

Because this API includes physical files (a .mcstructure for fake players) and uses @minecraft/vanilla-data for typing, you must configure your bundler (like esbuild) properly.

  • Add these scripts to your Add-on's package.json:

    • Copy the physical assets, You need to move the API's structures to your behavior pack

      You need to move the API's structures to your behavior pack

    "copy:api-assets": "node -e \"const fs = require('fs'); const src = 'node_modules/simplified-mojang-api/structures'; if (fs.existsSync(src)) fs.cpSync(src, 'behaviors/YOUR_ADDON/structures', { recursive: true, force: false });\""
    • Compile with esbuild

      Exclude the native Minecraft modules, but do not exclude @minecraft/vanilla-data so it gets bundled as pure strings.

    "compile": "npm run copy:api-assets && esbuild behaviors/YOUR_ADDON/src/main.ts --bundle --format=esm --outfile=behaviors/YOUR_ADDON/scripts/main.js --target=es2020 --external:@minecraft/server --external:@minecraft/server-ui --external:@minecraft/server-gametest --external:@minecraft/server-graphics --external:@minecraft/server-net --external:@minecraft/debug-utilities --external:@minecraft/gameplay-utilities --sourcemap"

API Examples:

Fast Offhand Items

Make items jump to the offhand with a single click.

import { customEventsManager } from "simplified-mojang-api";

// Any item with these words in its ID becomes a fast-equip item
customEventsManager.fastItemsSystem(["totem", "shield", "arrow"]);

Visual Debugging (Hitboxes)

Easily show visual hitboxes for all nearby entities using the debug module. Great for testing custom mob sizes or attack ranges!

import { debugToolsSimplified } from "simplified-mojang-api";

// Shows hitboxes to the specific player within a 50 block radius
debugToolsSimplified.showHitboxes(player, 50);

// Turn them off when you're done testing
// debugToolsSimplified.stopHitboxes();

Fake Player Spawner

Instantly spawn a simulated player into the world using the gametest API. Perfect for testing multiplayer mechanics solo.

import * as mc from "@minecraft/server";
import { fakePlysSimplified } from "simplified-mojang-api";

// Spawns a fake player named "Dummy" in Survival mode
fakePlysSimplified.createFakePly("Dummy", mc.GameMode.Survival);

Contributing

Found a bug or want to wrap a new Mojang method? PRs are super welcome!

Author: HaJuegos License: MIT