-
Notifications
You must be signed in to change notification settings - Fork 0
Add to CreativeModeTab Event
Maksym Uimanov edited this page Feb 12, 2026
·
1 revision
The @AddCreativeModeTab annotation is used to automatically add items and blocks to specific creative mode tabs during mod initialization. This annotation eliminates the need for manual creative tab registration by programmatically mapping items and blocks to vanilla creative tabs.
- Automates creative tab placement: Adds items/blocks to creative tabs without manual registration
- Supports multiple tabs: Allows items/blocks to appear in multiple creative tabs
- Integrates with initialization: Works seamlessly with Temporal API's initialization system
- Vanilla compatibility: Uses standard Minecraft creative tab organization
-
Annotation processing: The framework scans fields annotated with
@AddCreativeModeTab - Item/block extraction: Extracts item or block from the annotated field
- Tab resolution: Resolves specified creative tab types to their resource keys
-
Registration: Maps items/blocks to creative tabs in
CreativeModeTabEventHandler
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface AddCreativeModeTab {
CreativeModeTabType[] value();
}-
value(required): Array of creative tab types to add the item/block to
-
CreativeModeTabType.BUILDING_BLOCKS: Building blocks like bricks, concrete, glass -
CreativeModeTabType.COLORED_BLOCKS: Colored variants like wool, concrete powder, glass -
CreativeModeTabType.NATURAL_BLOCKS: Natural blocks like dirt, stone, wood, ores
-
CreativeModeTabType.FUNCTIONAL_BLOCKS: Functional blocks like chests, furnaces, crafting tables -
CreativeModeTabType.TOOLS_AND_UTILITIES: Tools, utility items, and miscellaneous items
-
CreativeModeTabType.COMBAT: Weapons, armor, and combat-related items
-
CreativeModeTabType.FOOD_AND_DRINKS: Food items and drinks -
CreativeModeTabType.INGREDIENTS: Raw materials, ingredients, and crafting components
-
CreativeModeTabType.REDSTONE_BLOCKS: Redstone components and mechanisms -
CreativeModeTabType.SPAWN_EGGS: Spawn eggs for mobs -
CreativeModeTabType.OP_BLOCKS: Operator blocks and special items
@AddCreativeModeTab(CreativeModeTabType.BUILDING_BLOCKS)
public static final DeferredBlock<?> EXAMPLE_BLOCK = BLOCK_FACTORY.create("example_block", BlockPropertiesFactory.empty());
@AddCreativeModeTab(CreativeModeTabType.BUILDING_BLOCKS)
public static final DeferredItem<?> EXAMPLE_SIGN = ITEM_FACTORY.createSign("example_sign", ExampleBlocks.EXAMPLE_SIGN, ExampleBlocks.EXAMPLE_WALL_SIGN);@AddCreativeModeTab(CreativeModeTabType.NATURAL_BLOCKS)
public static final DeferredBlock<?> EXAMPLE_ORE = BLOCK_FACTORY.create("example_ore", BlockPropertiesFactory.stone());@AddCreativeModeTab(CreativeModeTabType.FUNCTIONAL_BLOCKS)
public static final DeferredBlock<StandingSignBlock> EXAMPLE_SIGN = BLOCK_FACTORY.createStandingSignWithoutItem("example_sign", 1f, ExampleWoodTypes.EXAMPLE_WOOD_TYPE);@AddCreativeModeTab(CreativeModeTabType.COMBAT)
public static final DeferredItem<?> EXAMPLE_SWORD = ITEM_FACTORY.createSword("example_sword", Tiers.NETHERITE, 1, 1f);
@AddCreativeModeTab(CreativeModeTabType.COMBAT)
public static final DeferredItem<?> EXAMPLE_HELMET = ITEM_FACTORY.createArmor("example_helmet", ExampleArmorMaterials.EXAMPLE_ARMOR_MATERIAL, ArmorItem.Type.HELMET);@AddCreativeModeTab(CreativeModeTabType.TOOLS_AND_UTILITIES)
public static final DeferredItem<?> EXAMPLE_BOAT = ITEM_FACTORY.createBoat("example_boat", "EXAMPLE");
@AddCreativeModeTab(CreativeModeTabType.TOOLS_AND_UTILITIES)
public static final DeferredItem<?> EXAMPLE_MUSIC_DISC = ITEM_FACTORY.createMusicDisc("example_music_disc", ExampleJukeboxSongs.EXAMPLE_JUKEBOX_SONG);@AddCreativeModeTab(CreativeModeTabType.INGREDIENTS)
public static final DeferredItem<?> EXAMPLE_INGOT = ITEM_FACTORY.create("example_ingot");
@AddCreativeModeTab(CreativeModeTabType.INGREDIENTS)
public static final DeferredItem<?> EXAMPLE_FUEL = ITEM_FACTORY.create("example_fuel");@AddCreativeModeTab(CreativeModeTabType.SPAWN_EGGS)
public static final DeferredItem<?> EXAMPLE_SPAWN_EGG = ITEM_FACTORY.createSpawnEgg("example_spawn_egg", ExampleEntityTypes.EXAMPLE_ENTITY, 0x473A24FF, 0x71634FFF);@AddCreativeModeTab(CreativeModeTabType.REDSTONE_BLOCKS)
public static final DeferredBlock<?> EXAMPLE_REDSTONE_BLOCK = BLOCK_FACTORY.create("example_redstone_block", BlockPropertiesFactory.stone());@AddCreativeModeTab({CreativeModeTabType.INGREDIENTS, CreativeModeTabType.BUILDING_BLOCKS})
public static final DeferredItem<?> MULTI_TAB_ITEM = ITEM_FACTORY.create("multi_tab_item");- Logical grouping: Place items in their most logical category
- User expectations: Consider where players would look for items
- Multiple tabs: Use sparingly for items that truly belong in multiple categories
- Vanilla consistency: Follow vanilla Minecraft's organization patterns
- Cross-functional items: Tools that are both utility and building materials
- Armor sets: Sometimes fit in both combat and building categories
- Special blocks: Functional blocks that are also decorative
- All custom items: Every custom item should be placed in an appropriate tab
- All custom blocks: Every custom block should be placed in an appropriate tab
- Multi-category items: Items that logically belong in multiple tabs
- Vanilla replacement: Items that replace or extend vanilla functionality
- Mod organization: Ensuring proper organization for user experience
The annotation system integrates with Temporal API's metadata processing:
- Automatic registration: No manual event registration required
- Multi-tab support: Items can appear in multiple creative tabs
- Type safety: Uses reflection to ensure proper item/block types
-
Strategy pattern: Uses
AddCreativeModeTabStrategyfor processing -
Event handler integration: Works with
CreativeModeTabEventHandler - Vanilla compatibility: Uses standard Minecraft creative tab system
The annotation maps to AddCreativeModeTabStrategy that handles creative tab registration logic, allowing for easy extension and customization of the creative mode tab system.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples