CreativeTabRegistryHelper¶
open class CreativeTabRegistryHelper<T : CreativeModeTab>(modId: String) : RegistryHelper<T>
A RegistryHelper specialised for CreativeModeTab registration via Architectury's CreativeTabRegistry.
Example¶
object MyTabs : CreativeTabRegistryHelper<CreativeModeTab>(modId) {
val MY_TAB by create("my_tab") {
title(Component.translatable("itemGroup.mymod.my_tab"))
icon { ItemStack(MyBlocks.MY_BLOCK) }
displayItems { _, output ->
output.accept(MyBlocks.MY_BLOCK)
}
}
}
// In mod init:
MyTabs.init()
Parameters¶
-
T: The creative tab type; must extend CreativeModeTab.
-
modId: The mod ID used as the namespace for registered entries.
Constructors¶
CreativeTabRegistryHelper¶
constructor(modId: String)
Parameters
-
T: The creative tab type; must extend CreativeModeTab.
-
modId: The mod ID used as the namespace for registered entries.
Properties¶
registry¶
Functions¶
create¶
Registers a new CreativeModeTab using an Architectury CreativeTabRegistry builder.
Return
A RegistrySupplier for the registered creative tab.
Parameters
-
id: The registry name of the creative tab.
-
block: A builder lambda applied to CreativeModeTab.Builder to configure the tab.
getValue¶
Kotlin property delegate operator that unwraps a RegistrySupplier to its concrete value.
This enables the idiomatic val MY_ENTRY by register(...) pattern.
init¶
open fun init()
Registers this helper's DeferredRegister with the game's registry system.
Must be called once during mod initialization.
register¶
Registers a new entry and returns a RegistrySupplier for lazy access.
Return
A RegistrySupplier wrapping the registered entry.
Parameters
-
id: The entry's registry name (without namespace). The mod namespace is prepended automatically.
-
supplier: Factory producing the entry. Must not cache the returned instance.
Registers a new entry using a fully-qualified ResourceLocation and returns a RegistrySupplier.
Return
A RegistrySupplier wrapping the registered entry.
Parameters
-
id: The fully-qualified ResourceLocation for the entry.
-
supplier: Factory producing the entry. Must not cache the returned instance.