Skip to main content

API Overview

This page is for quick lookup only, not full teaching. It answers "which entry point should I start from?" and "what do common chains usually look like?"

note

The code snippets on this page are short excerpts from the runnable RegistryLibTest examples, not invented pseudo-code.

Which Entry Point Should I Start From?

What you want to doEntry pointWhat usually comes next
Register a regular or composite Itemitem("id", factory) or item("id")lang, defaultModel, addTab, addTooltip, attach
Register a component-driven Item with attachmentscomponentItem("id") or componentItem("id", factory)lang, defaultModel, addTooltip, attach
Register a Blockblock("id", factory) or block("id")initialProperties, simpleItem or item, loot, addTag
Register a Fluidfluid("id", still, flow)lang, clientExtension, properties, block, bucket
Register a BlockEntityblockEntity("id", factory)validBlock or validBlocks, renderer
Register a generic object in another registrygeneric("id", registryKey, factory) or simple(...)register or immediate completion
Register a creative tabcreativeTab("id")title, icon, content population
Share defaults across many entriesgroup("name")langPrefix, tab, initialBlockProperties, blockProperties, itemProperties, addBlockTag, addItemTag, addFluidTag
tip

If you're unsure, start with item(...) or block(...) —they cover the vast majority of registrations. See the How-to guides for step-by-step walkthroughs.

Builder Family Quick Lookup

BuilderResponsibilityEndpoint
ItemBuilderItem properties, model, tooltip, tab, recipe, tagItemEntry
BlockBuilderBlock properties, drops, block item, recipe, tagBlockEntry
FluidBuilderFluid type, rendering, block, bucket, tagFluidEntry
BlockEntityBuilderHost block binding and rendererBlockEntityTypeEntry

Entry Type Quick Lookup

TypeTypical use
ItemEntry<T>Reference an Item; create ItemStack and ItemResource values directly
BlockEntry<T>Reference a Block, its default state, and holder-style APIs expecting Holder<Block>
FluidEntry<T>Access source, type, block, bucket, FluidStack, and FluidResource together
BlockEntityTypeEntry<T>Reference a BlockEntityType with host binding

Entry Helper Quick Lookup

Entry helperWhat it gives you
ItemEntry.asStack()A default ItemStack without reconstructing the item manually
ItemEntry.readOnlyStack()Defensive copy of a cached ItemStack (count 1); safe against external mutation
ItemEntry.asResource()An ItemResource wrapper for transfer-related APIs
BlockEntry.getDefaultState()The block's default state for world placement or configuration
FluidEntry.getSource()The matching source fluid instance
FluidEntry.getType()The FluidType associated with the family
FluidEntry.getBlock() / getBucket()The related fluid block or bucket when they exist
FluidEntry.asStack() / asResource()Transfer-friendly fluid values without rebuilding them by hand
FluidEntry.readOnlyStack()A cached read-only FluidStack (1000 mB); avoids repeated allocations
note

Several Entry wrappers also satisfy holder-style usage directly. When another API expects a Holder<Item>, Holder<Block>, or Holder<Fluid>, the RegistryLib entry wrapper is often already usable as that value.

Common Chain Lookup

Minimal Item

REGISTRYLIB.item("copper_coin", Item::new)
.lang("Copper Coin")
.register();

Component Item with Attachments

REGISTRYLIB.componentItem("magic_wand")
.initialProperties(() -> new Item.Properties().stacksTo(1))
.properties(Item.Properties::fireResistant)
.lang("Magic Wand")
.defaultModel()
.attach(new InspectAttachment())
.register();

Minimal Block

REGISTRYLIB.block("decorative_stone", Block::new)
.initialProperties(() -> Blocks.STONE)
.lang("Decorative Stone")
.simpleItem()
.register();

Block Inside a Group

MACHINES.block("crusher", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK)
.defaultLoot()
.simpleItem()
.register();

See Also