promotional bannermobile promotional banner

Picker

/picker command to visualize registries

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);

Picker Team

profile avatar
  • 110
    Followers
  • 78
    Projects
  • 45.9M
    Downloads
Donate

More from IAFEnvoyView all