Class CreativeModeTab.Builder
java.lang.Object
net.minecraft.world.item.CreativeModeTab.Builder
- Enclosing class:
CreativeModeTab
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Identifierprivate booleanprivate final intprivate static final IdentifierDeprecated, for removal: This API element is subject to removal in a future version.private static final Identifierprivate Componentprivate static final CreativeModeTab.DisplayItemsGeneratorprivate booleanprivate intprivate final CreativeModeTab.Rowprivate intprivate booleanprivate @Nullable Identifierprivate Function<CreativeModeTab.Builder, CreativeModeTab> private final List<Identifier> private final List<Identifier> private IdentifierDeprecated, for removal: This API element is subject to removal in a future version.private CreativeModeTab.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackgroundTexture(Identifier backgroundTexture) build()displayItems(Collection<? extends Holder<? extends ItemLike>> collection) Helper to set this tabs contents to everything in the supplied Collection of Holders.displayItems(CreativeModeTab.DisplayItemsGenerator displayItemsGenerator) protected CreativeModeTab.Buildertype(CreativeModeTab.Type type) withLabelColor(int labelColor) Sets the color of the tab label.withScrollBarSpriteLocation(Identifier scrollBarSpriteLocation) Sets the location of the scroll bar background.Gives this tab a search bar.withSearchBar(int searchBarWidth) Gives this tab a search bar, with a specific width.withTabFactory(Function<CreativeModeTab.Builder, CreativeModeTab> tabFactory) withTabsAfter(Identifier... tabs) Define tabs that should come after this tab.final CreativeModeTab.BuilderwithTabsAfter(ResourceKey<CreativeModeTab>... tabs) Define tabs that should come after this tab.withTabsBefore(Identifier... tabs) Define tabs that should come before this tab.final CreativeModeTab.BuilderwithTabsBefore(ResourceKey<CreativeModeTab>... tabs) Define tabs that should come before this tab.withTabsImage(Identifier tabsImage) Deprecated, for removal: This API element is subject to removal in a future version.For removal in 26.3.
-
Field Details
-
EMPTY_GENERATOR
-
CREATIVE_INVENTORY_TABS_IMAGE
@Deprecated(forRemoval=true, since="26.2") private static final Identifier CREATIVE_INVENTORY_TABS_IMAGEDeprecated, for removal: This API element is subject to removal in a future version. -
CREATIVE_ITEM_SEARCH_BACKGROUND
-
row
-
column
private final int column -
displayName
-
iconGenerator
-
displayItemsGenerator
-
canScroll
private boolean canScroll -
showTitle
private boolean showTitle -
alignedRight
private boolean alignedRight -
type
-
backgroundTexture
-
spriteScrollerLocation
-
hasSearchBar
private boolean hasSearchBar -
searchBarWidth
private int searchBarWidth -
tabsImage
Deprecated, for removal: This API element is subject to removal in a future version. -
labelColor
private int labelColor -
tabFactory
-
tabsBefore
-
tabsAfter
-
-
Constructor Details
-
Builder
-
-
Method Details
-
title
-
icon
-
displayItems
public CreativeModeTab.Builder displayItems(CreativeModeTab.DisplayItemsGenerator displayItemsGenerator) -
alignedRight
-
hideTitle
-
noScrollBar
-
type
-
backgroundTexture
-
withSearchBar
Gives this tab a search bar.Note that, if using a custom
background image, you will need to make sure that your image contains the input box and the scroll bar. -
withSearchBar
Gives this tab a search bar, with a specific width.- Parameters:
searchBarWidth- the width of the search bar
-
withScrollBarSpriteLocation
Sets the location of the scroll bar background. -
withTabsImage
@Deprecated(forRemoval=true, since="26.2") public CreativeModeTab.Builder withTabsImage(Identifier tabsImage) Deprecated, for removal: This API element is subject to removal in a future version.For removal in 26.3. -
withLabelColor
Sets the color of the tab label. -
withTabFactory
public CreativeModeTab.Builder withTabFactory(Function<CreativeModeTab.Builder, CreativeModeTab> tabFactory) -
withTabsBefore
Define tabs that should come before this tab. This tab will be placed after thetabs. -
withTabsAfter
Define tabs that should come after this tab. This tab will be placed before thetabs. -
withTabsBefore
@SafeVarargs public final CreativeModeTab.Builder withTabsBefore(ResourceKey<CreativeModeTab>... tabs) Define tabs that should come before this tab. This tab will be placed after thetabs. -
withTabsAfter
@SafeVarargs public final CreativeModeTab.Builder withTabsAfter(ResourceKey<CreativeModeTab>... tabs) Define tabs that should come after this tab. This tab will be placed before thetabs. -
displayItems
public CreativeModeTab.Builder displayItems(Collection<? extends Holder<? extends ItemLike>> collection) Helper to set this tabs contents to everything in the supplied Collection of Holders. Intended for use withDeferredRegister.getEntries(), for Item or Block DeferredRegisters. Entries added through this method are filtered out ifItemLike.asItem()returnsItems.AIRor if disabled viaFeatureElement.isEnabled(FeatureFlagSet). Note that like the vanilla method this overrides any other calls for this tab todisplayItems(CreativeModeTab.DisplayItemsGenerator). -
build
-