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

@lpsmods/mcaddon-bridge

v0.1.0

Published

A package to communicate between Minecraft Add-Ons.

Downloads

29

Readme

@lpsmods/mcaddon-bridge

Version Downloads Issues

A package to communicate between Minecraft Add-Ons.

Dependencies

[
  { "module_name": "@minecraft/server", "version": "2.1.0" },
  { "module_name": "@minecraft/server-ui", "version": "2.0.0" }
]

Features

  • Send data between Add-Ons using packets.
  • Create your own API bridge for other Add-Ons!
  • Correlated responses, validation, timeouts, and automatic listener cleanup.
  • Async bridge methods, version negotiation, authorization hooks, and typed connection methods.

Example

Create the api.

import { Bridge } from "@lpsmods/mcaddon-bridge";

// Create a new bridge (aka API)
const api = new Bridge("com.example.myPack");

// Basic property
api.defineProperty("name", {
  value: "Steve",
  writable: true,
  enumerable: true,
  configurable: true,
});

// Getter and Setter
api.defineProperty("fullName", {
  get() {
    const firstName = this.getDynamicProperty("first_name");
    const lastName = this.getDynamicProperty("last_name");
    return `${firstName} ${lastName}`;
  },

  set(value) {
    const parts = value.split(" ");
    this.setDynamicProperty("first_name", parts[0]);
    this.setDynamicProperty("last_name", parts[1]);
  },
  enumerable: true,
  configurable: true,
});

// Simple function property
api.defineProperty("greet", {
  value: function (name: string) {
    console.warn(`Hello, ${name}!`);
  },
  writable: true,
  enumerable: true,
  configurable: true,
});

Use the API from a different pack.

import { world } from "@minecraft/server";
import { connect } from "@lpsmods/mcaddon-bridge";

async function worldLoad(): Promise<void> {
  // Connect to the api
  try {
    const api = await connect("com.example.myPack", {
      version: "^1.0.0",
      timeoutTicks: 100,
    });
    console.warn(await api.get<string>("name"));
    await api.set("name", "Bob");
    console.warn(await api.get<string>("fullName"));
    await api.call<void>("greet", "Alex");
  } catch (err) {
    console.warn(`API error: ${String(err)}`);
  }
}

world.afterEvents.worldLoad.subscribe(worldLoad);

The older connect(addonId, version?) overload and misspelled writeable descriptor option remain supported for compatibility. New code should use ConnectionOptions and writable.

Reliability and lifecycle

Requests time out after 100 game ticks by default. Pass timeoutTicks: 0 to disable this behavior. Timed-out and completed requests always remove their packet listeners. Failures reject with exported BridgeError subclasses such as BridgeTimeoutError, BridgeProtocolError, and BridgeRemoteError.

Use bridge.dispose() or Bridge.unregister(addonId) when an API is no longer available. Duplicate bridge IDs throw instead of silently replacing an existing bridge. A connection can be marked locally disconnected with connection.disconnect().

Descriptors enforce writes and deletion. Values require writable: true to be changed, setter descriptors remain writable through their setter, and only configurable: true properties can be removed. bridge.keys() returns enumerable properties.

Bridge functions may return promises; callers receive their resolved value. An optional BridgeOptions.authorize(request, sender) hook can synchronously or asynchronously deny requests. Script-event senders can be imitated by another pack, so packs in the same world must still be treated as mutually trusted.

Not associated with or approved by Mojang Studios or Microsoft