diff options
| author | ZestyBlaze <68081568+ZestyBlaze@users.noreply.github.com> | 2024-01-23 01:00:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 02:00:54 +0100 |
| commit | d28b3b6d7cb13c4ded5dbfc53ba8e7d29348b706 (patch) | |
| tree | 84d53802e23677043c5328f80fc3a9754545b642 /src | |
| parent | 67a45757309f6aa05851350da316d755222949c7 (diff) | |
Add `.title` to CreativeModeTab example (#35)
To better show how to create Tabs
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/example/examplemod/ExampleMod.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java index 86686e8..9096c03 100644 --- a/src/main/java/com/example/examplemod/ExampleMod.java +++ b/src/main/java/com/example/examplemod/ExampleMod.java @@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils; import net.minecraft.client.Minecraft; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; @@ -56,6 +57,7 @@ public class ExampleMod // Creates a creative tab with the id "examplemod:example_tab" for the example item, that is placed after the combat tab public static final DeferredHolder<CreativeModeTab, CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder() + .title(Component.translatable("itemGroup.examplemod")) //The language key for the title of your CreativeModeTab .withTabsBefore(CreativeModeTabs.COMBAT) .icon(() -> EXAMPLE_ITEM.get().getDefaultInstance()) .displayItems((parameters, output) -> { |
