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
tutorial:itemgroup [2024/08/23 12:57] – [Create your own item group] correct codes solidblocktutorial:itemgroup [2024/08/23 13:03] (current) solidblock
Line 45: Line 45:
 </yarncode> </yarncode>
  
-In practice, considering items you register may be in large quantities, it's recommended to place then in a particular method, instead of directly in your ''ModInitializer''This is an example (if do so, remember to undo the codes above):+In practice, considering items you register may be in large quantities, it's recommended to place then in a particular method, instead of directly in your ''ModInitializer''See the following example (if write like this, remember to undo the codes above):
  
 <yarncode java [enable_line_numbers="true"]> <yarncode java [enable_line_numbers="true"]>
Line 51: Line 51:
     // [...]     // [...]
          
-    public static void registerItemGroups() {+    public static void registerToVanillaItemGroups() {
         ItemGroupEvents.modifyEntriesEvent(class_7706.field_40195).register(content -> {         ItemGroupEvents.modifyEntriesEvent(class_7706.field_40195).register(content -> {
             content.addAfter(class_1802.field_8691, CUSTOM_ITEM);             content.addAfter(class_1802.field_8691, CUSTOM_ITEM);
Line 63: Line 63:
     @Override     @Override
     public void onInitialize() {     public void onInitialize() {
-        TutorialItems.registerItemGroups();+        TutorialItems.registerToVanillaItemGroups();
     }     }
 } }
Line 133: Line 133:
  
 :!: The screenshot below is outdated. :!: The screenshot below is outdated.
 +
 {{:tutorial:item_group_append_items.png?nolink&400|}} {{:tutorial:item_group_append_items.png?nolink&400|}}
tutorial/itemgroup.1724417820.txt.gz · Last modified: 2024/08/23 12:57 by solidblock