• Forums

Navigation

  • Home
  • Style Guide
  • Getting Started
    • Home
    • Structuring Your Mod
    • Forge Update Checker
    • Dependency Management
    • Debug Profiler
  • Concepts
    • Sides
    • Resources
    • Registries
    • The Fingerprint Violation Event
    • Internationalization and localization
  • Blocks
    • Home
    • Intro to Blockstates
    • Interaction
  • Animation API
    • Intro to the Animation API
    • Armatures
    • Animation State Machines
    • Using the API
  • Tile Entities
    • Home
    • Special Renderer
  • Items
    • Home
    • Loot Tables
  • Models
    • Intro to Models
    • Model Files
    • Blockstates
      • Intro to Blockstate JSONs
      • Forge Blockstate JSON
    • Connecting Blocks and Items to Models
    • Coloring Textures
    • Item Property Overrides
    • Advanced Models
      • Intro to Advanced Models
      • IModel
      • IModelState and IModelPart
      • IBakedModel
      • Extended Blockstates
      • Perspective
      • ItemOverrideList
      • ICustomModelLoader
  • Rendering
    • TileEntityItemStackRenderer
  • Events
    • Basic Usage
  • Networking
    • Home
    • Overview
    • SimpleImpl
    • Entities
  • Data Storage
    • Capabilities
    • World Saved Data
    • Extended Entity Properties
    • Config Annotations
  • Utilities
    • Recipes
    • OreDictionary
      • OreDictionary Name Convention
      • WILDCARD_VALUE
      • Using OreDictionary in Crafting Recipes
      • Registering Items to the OreDictionary
      • Common OreDictionary Names
    • PermissionAPI
  • Effects
    • Sounds
  • Conventions
    • Versioning
    • Locations
    • Loading Stages
  • Contributing to Forge
    • Getting Started
    • PR Guidelines

OreDictionary

The OreDictionary exists primarily for inter-mod compatibility.

Items that are registered to the OreDictionary become interchangeable with other items that have the same OreDictionary name. This allows recipes to use either item to produce the same result.

Despite its name, the OreDictionary is used for much more than ores. Any item that is similar to another item (for example, dyes) can be registered to and used with the OreDictionary.

OreDictionary Name Convention

Note

Because OreDictionary names are meant to be shared between items from different mods, they should be fairly general. Use a name that other mods are likely to use.

Forge does not require names to be in any particular format, but the following has become a popular standard for OreDictionary names:

The entire OreDictionary name typically uses camelCase (compound words that begin with a lowercase letter, where each successive word begins with a capital letter) and avoids spaces or underscores.

The first word in the OreDictionary name indicates the type of item. For unique items (such as record, dirt, egg, and vine), one word is specific enough.

The last part of the name indicates the material of the item. This differentiates between ingotIron and ingotGold, for example.

When two words are not specific enough, a third word can be added. For instance, granite is registered as blockGranite while polished granite is registered as blockGranitePolished.

See Common OreDictionary Names for a list of commonly used prefixes and suffixes.

WILDCARD_VALUE

This value is used to indicate that the metadata of an ItemStack is not important. See below for an example of its use.

Using OreDictionary in Crafting Recipes

Recipes that use the OreDictionary are created and registered in much the same way as regular crafting recipes. The main difference is the use of an OreDictionary name instead of a specific Item or ItemStack.

To make a recipe that can use OreDictionary entries, create an ingredient with type of forge:ore_dict in your recipe json, and specify the ore dictionary entry name in ore field:

{
    "type": "forge:ore_dict",
    "ore": "ingotIron"
}

More information about recipe json may be found here.

Another use of the OreDictionary in crafting is the WILDCARD_VALUE. Use by passing 32767 into data field of a regular item ingredient:

{
    "item": "minecraft:wool",
    "data": 32767
}

Note

The constant OreDictionary.WILDCARD_VALUE (32767) should only be used for the recipe input. Using WILDCARD_VALUE in the recipe output will only hardcode the damage of the output ItemStack.

Registering Items to the OreDictionary

Add entries to the OreDictionary during registry events, after registering your items.

Simply call OreDictionary.registerOre(ItemStack stack, String name) with an ItemStack containing your item or block and its metadata value to register it to the OreDictionary.

You can also call one of the overloads of OreDictionary.registerOre that take a Block or Item to avoid creating the ItemStack yourself.

See OreDictionary Name Convention for tips on formatting the OreDictionary name of the ItemStack.

Common OreDictionary Names

All OreDictionary names for Minecraft items and blocks can be found in net.minecraftforge.oredict.OreDictionary. A full list will not be included here.

Common prefixes already used in the OreDictionary include ore, ingot, nugget, dust, gem, dye, block, stone, crop, slab, stair, and pane.

Common prefixes for modded items include gear, rod, stick, plate, dustTiny, and cover.

Common suffixes in the OreDictionary include Wood, Glass, Iron, Gold, Leaves, and Brick.

Common suffixes for modded items include the names of metals (Copper, Aluminum, Lead, Steel, etc.) and other modded materials.

Built with MkDocs using a custom theme. Hosted by Read the Docs.
Enable Dark Theme