tutorial:itemgroup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:itemgroup [2023/06/11 08:46] – Update to 1.20 mcrafterzz | tutorial:itemgroup [2023/10/01 03:21] (current) – Remove semicolon to nowhere haykam | ||
---|---|---|---|
Line 38: | Line 38: | ||
private static final class_1761 ITEM_GROUP = FabricItemGroup.builder() | private static final class_1761 ITEM_GROUP = FabricItemGroup.builder() | ||
.icon(() -> new class_1799(CUSTOM_ITEM)) | .icon(() -> new class_1799(CUSTOM_ITEM)) | ||
- | | + | .displayName(class_2561.method_43469(" |
+ | .entries((context, | ||
+ | entries.add(CUSTOM_ITEM); | ||
+ | }) | ||
.build(); | .build(); | ||
</ | </ | ||
+ | |||
+ | You can add entries to your item group within the '' | ||
It is important to set the display name, otherwise it will cause a crash. | It is important to set the display name, otherwise it will cause a crash. | ||
- | The next step is to register your itemGroup. | + | The next step is to register your item group. |
- | + | ||
- | < | + | |
- | Registry.register(Registries.ITEM_GROUP, | + | |
- | </ | + | |
- | + | ||
- | You can use '' | + | |
< | < | ||
- | ItemGroupEvents.modifyEntriesEvent(ITEM_GROUP).register(content -> { | + | class_2378.method_10230(class_7923.field_44687, |
- | content.add(CUSTOM_ITEM); | + | |
- | }); | + | |
</ | </ | ||
{{: | {{: |
tutorial/itemgroup.1686473197.txt.gz · Last modified: 2023/06/11 08:46 by mcrafterzz