Filters API
  • Home
  • Tips
  • Using Filters API
    • Setting up
    • Registering filters
    • Adding items
  • Advanced
    • Registering uncategorized filter
    • Configuring reserved button
    • Disabling filters
  • Unsupported
    • Introduction
    • Sorting filters
    • Removing filters
Powered by GitBook
On this page

Was this helpful?

  1. Advanced

Configuring reserved button

Filters API is a complete library.

PreviousRegistering uncategorized filterNextDisabling filters

Last updated 8 months ago

Was this helpful?

Filters API has a third button for all tabs. Usually, it can be used to open the options menu.

The core of the button is onPress, the shows of the button depend on whether onPress is null.

Call FilterBuilder.setReservedButton(ItemGroup, Text, PressAction) to add the "Reserved button".

FilterBuilder.setReservedButton(CREATIVE_MODE_TAB, new TranslatableText("tooltip.modid.options"), button -> foo());

Icon UV is not available in 1.20.6 or above.

By default, the icon of the button is the icon that the showcase image above shows. If you want the customized icon, call FilterBuilder.setReservedButton(ItemGroup, Text, PressAction, Identifier, int, int)

FilterBuilder.setReservedButton(CREATIVE_MODE_TAB, new TranslatableText("tooltip.modid.options"), button -> foo(), ICONS, 16, 0);

See also

FilterBuilder
The javadoc (1.16~1.19.4)
The third button on the left is "reserved button".