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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bdsx/containermenu

v1.2.6

Published

ContainerMenu - An API allowing you to create fake container menus.

Downloads

7

Readme

ContainerMenu - A BDSX API

ContainerMenu is an API for BDSX that allows you to create fake interactive container menus !


Features

  • Multiple containers support

  • Item transactions detection

  • container close detection

  • possibility to dynamically change items

  • custom container name !

  • easy to use API

Available container types

  • [x] Chest

  • [x] Double chest

  • [x] Trapped chest

  • [x] Double trapped chest

  • [x] Hopper

  • [x] Dropper

  • [x] Dispenser

...and more to come !

Soon to be added

  • Handling of non cancelled item transactions (possibility to take/place items)

  • More container types

Installation

Installing as an npm module

run this command in your bdsx directory :

npm i @bdsx/containermenu

You can also use bdsx's plugin-manager

Installing as a standalone plugin

clone the repository in your plugins directory :

git clone https://github.com/Se7en-dev/ContainerMenu.git

Usage examples

You can simply create and display a fake chest this way :

const container = ContainerMenu.create(player, FakeContainerType.Chest);
container.sendToPlayer();

everything else is handled automatically !

You can add/delete items to the container this way :

// Sets the item in slot 0
container.setItem(0, ItemStack.constructWith("minecraft:diamond", 64));
// Adds the item to the first empty slot
container.addItem(ItemStack.constructWith("minecraft:diamond", 64));
// Set multiple items at once
container.setContents({
            5: ItemStack.constructWith("minecraft:gold_ingot", 1),
            7: ItemStack.constructWith("minecraft:iron_ingot", 1),
            9: ItemStack.constructWith("minecraft:emerald", 1),
        });
// Clears the item in slot 5
container.clearItem(5);
// Clears all items
container.clearContents();

no need to destruct the ItemStacks, it is done automatically after the container is closed

Other features :

// Set a custom name to the container
// (must be called before sending the container)
container.setCustomName("BDSX is awesome !");
// Closes the container client-side, and destructs it.
container.closeContainer();

Using callbacks :

container.onTransaction((action) => {
    // Do something here...
});

container.onContainerClose(() => {
    // Do something here...
});

nb: returning CANCEL for item transactions does not change anything for now. In the future, Items will be able to be placed and taken unless CANCEL is returned.

Simple examples

Sends a message when a diamond is clicked :

const container = ContainerMenu.create(actor, FakeContainerType.Chest);
        container.addItem(ItemStack.constructWith("minecraft:iron_ingot", 1));
        container.addItem(ItemStack.constructWith("minecraft:gold_ingot", 1));
        container.addItem(ItemStack.constructWith("minecraft:diamond", 1));
        container.sendToPlayer();
        container.onTransaction((action) => {
            if(action.type === ItemStackRequestActionType.Take && container.getItem(action.getSrc().slot)?.getName() === "minecraft:diamond") {
                container.closeContainer();
                actor.sendMessage("You have clicked the diamond!");
            }
        });

Sends a message when the player closes the container:

const container = ContainerMenu.create(actor, FakeContainerType.Chest);
        container.sendToPlayer();
        container.onContainerClose(() => {
            actor.sendMessage("Container closed !");
        });

Advanced usage

Item destruction :

When creating a fake container, if destructItems is set to true, items will be automatically destructed on container close. If set to false they won't, and need to be destructed manually (if needed to).

// The items will not be destructed when the container is closed
const container = ContainerMenu.create(actor, FakeContainerType.DoubleChest, false);

This parameter can be overriden when calling item-related methods :

// The old item at slot 0 will not be destructed (destructItems is set to false)
container.setItem(0, ItemStack.constructWith("minecraft:diamond", 1));
// The old item at slot 0 will be destructed (destructItems is overriden to true)
container.setItem(0, ItemStack.constructWith("minecraft:diamond", 1), true);

All items can be destructed at once :

// This is called automatically if destructItems is set to true
container.destructAllItems();

Credits

API base by @Rjlintkh

This plugin is licensed under GNU General Public License v3.0

Feel free to contribute :)