Class FabricItemGroup
java.lang.Object
net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup
Contains a method to create an item group builder.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ItemGroup.Builder
builder
(Identifier identifier) Creates a new builder forItemGroup
.
-
Method Details
-
builder
Creates a new builder forItemGroup
. Item groups are used to group items in the creative inventory.Each new
ItemGroup
instance of this class is automatically appended toItemGroups.getGroups()
whenItemGroup.Builder.build()
is invoked.Example:
private static final ItemGroup ITEM_GROUP = FabricItemGroup.builder(new Identifier(MOD_ID, "test_group")) .icon(() -> new ItemStack(Items.DIAMOND)) .entries((enabledFeatures, entries, operatorEnabled) -> { entries.add(TEST_ITEM); }) .build();
- Parameters:
identifier
- the id of the ItemGroup, to be used as the default translation key- Returns:
- a new
ItemGroup
instance
-