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 14:44] mcrafterzztutorial:itemgroup [2019/02/19 15:03] mcrafterzz
Line 4: Line 4:
    @Override    @Override
    public void onInitialize() {    public void onInitialize() {
-       ItemGroup itemGroup = FabricItemGroupBuilder.create("modid:name")})).icon(() -> new ItemStack   +       public static final ItemGroup ITEM_GROUP = FabricItemGroupBuilder.create(new Identifier("modid", "name")})).icon(() -> new ItemStack(block)).build();
-       (block)).build();+
    }    }
  
-The modid is the id of your mod, name is the name of the creative tabs (must be lowercase to not crash). The icon is should be an itemstack, created with either an item or a block like in this case. To add blocks to your item group use //.itemGroup(itemGroup)// when creating it.+The modid is the id of your mod, name is the name of the creative tabs (must be lowercase to not crash). The icon is should be an itemstack, created with either an item or a block like in this case for example //Blocks.Grass//. To add blocks to your item group use //.itemGroup(itemGroup)// when creating it.
  
-   public static final Item FABRIC_ITEM = new Item(new Item.Settings().itemGroup(itemGroup));+   public static final Item FABRIC_ITEM = new Item(new Item.Settings().itemGroup(ITEM_GROUP));
  
 Creating an item group is as easy as that! Creating an item group is as easy as that!
tutorial/itemgroup.txt · Last modified: 2024/07/03 06:57 by solidblock