Minecraft registries
Find blocks, items, entities, tags, and protocol features for the bot's Minecraft version.
bot.registry reads Minecraft data for the bot's negotiated protocol version.
Use it instead of hard-coded numeric IDs, copied data files, or version assumptions.
Identify the active registry
const registry = yield* bot.registry.identity();
yield* Effect.logInfo("registry", {
minecraftVersion: registry.identity?.minecraftVersion,
hash: registry.identity?.registryHash,
kinds: registry.supportedKinds,
});The identity includes versions, protocol number, registry hash, supported data types, and protocol features. Use the hash as the cache key for downloaded registry data.
Read entries
const axes = yield* bot.registry.entries({
kind: RegistryKind.ITEM,
tags: ["minecraft:axes"],
pageSize: 100,
});
const diamondPickaxe = yield* bot.registry.entry({
kind: RegistryKind.ITEM,
id: "minecraft:diamond_pickaxe",
});axes = await bot.registry.entries(
REGISTRY_KIND_ITEM,
tags=["minecraft:axes"],
page_size=100,
)
diamond_pickaxe = await bot.registry.entry(
REGISTRY_KIND_ITEM,
"minecraft:diamond_pickaxe",
)An entry contains its namespaced ID, optional protocol-specific numeric ID, display name, semantic properties, and tags. Available kinds include blocks, items, entity types, biomes, dimensions, recipes, enchantments, effects, attributes, game events, sounds, particles, and containers.
Follow nextPageToken or next_page_token until it is empty. Keep the
registry hash with every cached page so data from different protocol versions
cannot be mixed.
Inspect tags
bot.registry.tags(...) lists tag IDs and their member IDs. Filter by prefix
when an application only needs one namespace or tag family.
const mineableTags = yield* bot.registry.tags({
kind: RegistryKind.BLOCK,
prefix: "minecraft:mineable/",
pageSize: 100,
});Tags are the right input for portable selectors. A task that accepts every log, pickaxe, hostile entity, or replaceable block can use tag membership rather than a hand-maintained list.
Registry reads are semantic and version-aware. If an experiment needs an exact packet ID or codec field, inspect the negotiated protocol schema separately.
How is this page?
Last updated on
