Configuring reserved button

Filters API is a complete library.

The third button on the left is "reserved button".

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

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

The javadoc (1.16~1.19.4)

Last updated

Was this helpful?