User Tools

Site Tools


tutorial:itemgroup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:itemgroup [2019/02/19 15:03] mcrafterzztutorial:itemgroup [2019/02/21 13:17] mcrafterzz
Line 2: Line 2:
 Do you want your blocks and items blocks to have their own group in the creative inventory? Then that can easly be fixed. The most common way to create one is to use //FabricItemGroupBuilder.create//. Like items and blocks this has to be done in //onInitialize// method to work correctly. Do you want your blocks and items blocks to have their own group in the creative inventory? Then that can easly be fixed. The most common way to create one is to use //FabricItemGroupBuilder.create//. Like items and blocks this has to be done in //onInitialize// method to work correctly.
  
 +   public static final ItemGroup ITEM_GROUP;
    @Override    @Override
    public void onInitialize() {    public void onInitialize() {
-       public static final ItemGroup ITEM_GROUP = FabricItemGroupBuilder.create(new Identifier("modid", "name")})).icon(() -> new ItemStack(block)).build();+       ITEM_GROUP = FabricItemGroupBuilder.create(new Identifier("modid", "name")})).icon(() -> new ItemStack(block)).build();
    }    }
  
tutorial/itemgroup.txt · Last modified: 2023/10/01 03:21 by haykam