MonitoringMinecraft MonitoringMinecraft

MenuKit: Containers

Мод Fabric

Расширение слотов для MenuKit в Майнкрафт: кастомные меню контейнеров, состояние слотов и группировка регионов. Требует MenuKit.

23 скачивания 0 подписчиков
Оцените первым

MenuKit: Containers

Slot extension for MenuKit. Custom container menus, per-slot state, slot-group regions, contract verification — built on the MenuKit UI library.

What it is

MenuKit: Containers (MKC) adds slot machinery to MenuKit. If you're building a Fabric mod with custom container UIs — storage blocks with new slot layouts, real slots grafted onto vanilla menus, inventory mods that need per-slot state, anything that goes through a ScreenHandler — MKC provides:

  • MenuKitScreenHandler — a container-menu handler designed to integrate cleanly with MenuKit's panel system.
  • MenuKitHandledScreen — the screen-side companion that combines MK panels with vanilla slots in one frame.
  • Per-slot state (M1). Server-authoritative state attached to individual slots; auto-synced to the client.
  • Slot-group regions. Group slots into named regions and anchor MK panels to those regions, just like menu regions.
  • Custom payloads. Typed networking primitives for slot state, ready to wire into your custom protocol.
  • Contract verification. Built-in validators for slot/UI invariants.

MKC depends on MenuKit. Depending on MKC pulls in MenuKit transitively — you don't need both dependencies in your gradle build.

Install

Add the Modrinth Maven repository and the MKC dependency to your build.gradle:

repositories {
    maven { url 'https://api.modrinth.com/maven' }
}

dependencies {
    modImplementation 'maven.modrinth:menukit-containers:1.1.0'
    // MenuKit is pulled in transitively via api — no need to declare it separately
}

And declare both dependencies in your src/main/resources/fabric.mod.json:

"depends": {
    "menukit": "*",
    "menukit-containers": "*"
}

MKC is universal (environment: *) — runs on both client and server. MenuKit stays client-only.

Quickstart

// 1. Define a screen handler by extending MenuKitScreenHandler
public class MyMenuHandler extends MenuKitScreenHandler {
    public MyMenuHandler(int syncId, Inventory playerInventory, ContainerLevelAccess access) {
        super(MY_MENU_TYPE, syncId, playerInventory);
        // Register slots, set up storage attachments, etc.
        // See MenuKitScreenHandler javadoc for the standard hooks.
    }
}

// 2. Companion screen on the client
public class MyMenuScreen extends MenuKitHandledScreen<MyMenuHandler> {
    public MyMenuScreen(MyMenuHandler handler, Inventory inventory, Component title) {
        super(handler, inventory, title);
    }
    // Override panel layout if needed; default plays nicely with MK regions.
}

// 3. Open from the server side
player.openMenu(new SimpleMenuProvider((syncId, inv, p) ->
    new MyMenuHandler(syncId, inv, accessor), Component.literal("My Menu")));

Feature highlights

  • Custom container menusMenuKitScreenHandler + MenuKitHandledScreen for clean integration with MK's panel system.
  • Per-slot state (M1)MKSlotState attaches arbitrary state to individual slots; server-authoritative, auto-synced to the client (SlotStateBag, SlotStateClientCache).
  • Slot-grafting onto vanilla menus — add real, persistent, server-synced slots to existing vanilla screens (the player inventory, placed containers) without owning the screen. Grafted slots handle click-through correctly and can reposition at runtime; you write the menu mixin, MKC ships the kit.
  • Block-portable slot state — per-slot state can survive a shulker being broken, carried, and replaced, via a generic library-owned bridge. You register a channel; the travel is automatic.
  • Shared or private slot state — register a channel as per-player-private (default) or shared (one cross-player-visible value per slot, synced live to every viewer).
  • Placed-container reach — double-chest resolution, menu-free server-side reads (for automation like hoppers), and a client-capability query. The library resolves containers, exposes state, and reports capability; your mod owns the enforcement policy.
  • Slot-group regions — group slots into named regions; anchor MK panels to those groups.
  • Storage primitivesStorage, KeyedStorage, PlayerStorage, EphemeralStorage, StorageAttachment cover most container patterns.
  • Custom payloadsSlotStateUpdateC2SPayload, SlotStateSnapshotS2CPayload, SlotStateUpdateS2CPayload for the slot-state protocol; pattern is reusable for your own typed payloads.
  • Contract verificationContractVerification validates slot/UI invariants at runtime.

License

MIT. See LICENSE.

Issues

File issues at github.com/trevorschoeny/menukit-containers/issues.

Смотри также

Похожие подборки моды — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
999 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
MigosMc
MigosMc Java + BE
1068 онлайн
1.8 — 26.2 версия
🌿 MigosMc.net | Гриферский сервер с войс-чатом | Награды за онлайн ⭐ ВЫЖИВАНИЕ⭐ ОДИНБЛОК⭐ МИНИ-ИГРЫ
SeasonEra
0 онлайн
26.1.2 версия
Выживание • Экономика • Кланы • Приваты • Донат
PLIRGAME - ДЕВУШКИ ВОЙС ЧАТ
29 онлайн
1.21.10 — 26.1.1 версия
❤️ Выживание! ❤️ Войс Чат ❤️ Девушки ❤️ /free
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.8. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат