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

@mcbepack/api

v1.0.6

Published

Readme

@mcbepack/api

Helper utilities for Minecraft Bedrock Script API projects.

Installation

bun add @mcbepack/api

Generated mcbepack Script API projects include this package by default.

This package expects @minecraft/server to be provided by your Script API runtime. It is built against @minecraft/server 2.4.0 or newer.

Exports

import { Advancedboard, DynamicProperty } from "@mcbepack/api";

DynamicProperty

DynamicProperty<T> stores JSON records in Minecraft dynamic properties. Each record receives a generated string id, and created records are cached in values.

Dynamic properties can be stored on a World, Entity, Player, or ItemStack.

import { world } from "@minecraft/server";
import { DynamicProperty } from "@mcbepack/api";

type PlayerStats = {
  name: string;
  kills: number;
};

const stats = new DynamicProperty<PlayerStats>("stats", world);

const steve = stats.create({ name: "Steve", kills: 0 });

stats.update(
  (entry) => entry.id === steve.id,
  (entry) => ({ ...entry, kills: entry.kills + 1 }),
);

const current = stats.find((entry) => entry.id === steve.id);

Methods

| Method | Description | | --- | --- | | create(value) | Creates a record, stores it, and returns the created record with id. | | find(predicate) | Returns the first matching record, or undefined. | | count(predicate?) | Returns the total number of records, or matching records when a predicate is passed. | | update(predicate, updater) | Updates every matching record with the returned value from updater. | | delete(predicate) | Deletes every matching record. | | clear() | Deletes all records in this collection. |

Stored dynamic property keys use the format db:<name>:<id>.

Existing data is loaded after the Minecraft worldLoad event. If you need to read previously saved records, access values after the world has loaded.

Advancedboard

Advancedboard wraps common scoreboard operations. It automatically creates a scoreboard objective when the objective does not exist.

import { world } from "@minecraft/server";
import { Advancedboard } from "@mcbepack/api";

Advancedboard.initialize(world.scoreboard);

world.afterEvents.playerSpawn.subscribe(({ player }) => {
  Advancedboard.add("joins", player, 1);

  const joins = Advancedboard.get("joins", player);
  player.sendMessage(`Joins: ${joins}`);
});

Methods

| Method | Description | | --- | --- | | initialize(scoreboard) | Sets the scoreboard instance used by the helper. | | get(name, player) | Gets a player's score, returning 0 when no score is set. | | set(name, player, value) | Sets a player's score. | | add(name, player, value) | Adds to a player's current score. | | reset(name, player) | Sets a player's score to 0. | | delete(name, player, value) | Subtracts from a player's current score. |

If initialize is not called, Advancedboard falls back to world.scoreboard.

Related Packages

License

GPL-3.0. See LICENSE.