Inventory
cinnabar:extension/inventory@0.1.0
Vanilla inventory requests a player mod asks for; each is one the vanilla screens can make,
and the server checks it. Every function errs without the inventory permission. Requests
are sent after the callback returns, at most MAX_INVENTORY_REQUESTS per callback.
Grants: inventory.
Imported type item-key: item-key.
Types
Functions
swap-offhand
swap-offhand: func(slot: u8) -> result<_, string>;
Exchanges player inventory cell slot (0..35, hotbar first) with the offhand.
Requires focused gameplay and inventory authority; occupied equipment must admit the
incoming item. The cursor is untouched. Committed after a successful callback and
resolved against the current inventory ledger; server validation still applies.
creative-take
creative-take: func(key: item-key, count: u8) -> result<_, string>;
Takes count of creative item key into the first free inventory slot, else the
cursor, as a click on the creative catalog does. Errs outside Creative or when the
item is not in the creative content.
Types: item-key.
fill-recipe
fill-recipe: func(network-id: u32) -> result<_, string>;
Crafts crafting recipe network-id once from inventory ingredients onto the cursor, as
a click on the recipe book does. Errs while no crafting screen is up.