Picker

Quick rating

Community listing page, reviews may not be monitored by the author.

Picker

No reviews yet

/picker command to visualize registries

Mod Loaders
Minecraft

About

Description

Picker

A creative-mode search page over datapack registries.

/picker opens the grid over every category the installed mods registered, /picker <category> over one of them (minecraft:block, …).

The picker registers two categories of its own: minecraft:item and minecraft:block.

For mod authors

A category names one datapack registry and turns an entry of it into the rows that stand for it. Register it once, while your mod class is being constructed:

PickerCatalogue.registerSingle(MyRegistries.SPIRIT_ROOT, holder -> new PickerRow(
        MyItems.SPIRIT_ROOT.toStack(),
        List.of(Component.literal(holder.key().identifier().toString()))));

PickerCatalogue.register(...) is the same for a definition that stands for several items, and PickerCatalogue.registerCategory(...) hands over the whole category for a definition that answers in its own order or reads a second registry.

Reading goes through PickerContents and always takes the registry access to read from, so the client reads the registries it has synced and the server its own:

List<ItemStack> stacks = PickerContents.stacksOf(registryAccess, MyRegistries.SPIRIT_ROOT);