From d28b3b6d7cb13c4ded5dbfc53ba8e7d29348b706 Mon Sep 17 00:00:00 2001 From: ZestyBlaze <68081568+ZestyBlaze@users.noreply.github.com> Date: Tue, 23 Jan 2024 01:00:54 +0000 Subject: [PATCH] Add `.title` to CreativeModeTab example (#35) To better show how to create Tabs --- src/main/java/com/example/examplemod/ExampleMod.java | 2 ++ 1 file changed, 2 insertions(+) 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 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) -> {