When the IOreDict is the lexicon, the IOreDictEntries are the lexicon’s entries.
They consist of a name (OreDictionary name) and an explanation (all matching items).

Importing the package

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.oredict.IOreDictEntry;

Retrieving such an Object.

There are multiple ways of getting an IOreDictEntry Object: If you refer to an oreDict that does not yet exist, it will be created.


You can use these getters to retrieve some information on the oredict:

name Description Return type
name Returns the oreDict’s name string
empty Returns if the oreDict is empty bool
firstItem Returns the first of the oreDict’s items IItemStack


You can use these methos on an IOreDictEntry Object:

Add/Remove items

val oreDictEnt = <ore:ingotIron>;

//oreDictEnt.add(IItemStack... item_items);
oreDictEnt.add(<minecraft:iron_ore>, <minecraft:dirt>);

//oreDictEnt.addItems(IItemStack[] items);
oreDictEnt.addItems([<minecraft:redstone>, <minecraft:gold_ore>]);

//oreDictEnt.addAll(IOreDictEntry otherEntry);

//oreDictEnt.remove(IItemStack... item_items);
oreDictEnt.remove(<minecraft:iron_ore>, <minecraft:dirt>);

//oreDictEnt.removeItems(IItemStack[] items);
oreDictEnt.removeItems([<minecraft:redstone>, <minecraft:gold_ore>]);

Check if an IOreDictEntry contains an item

You can check if aan IOreDictEntry contains an item using either the in or has keywords:

val oreDictEnt = <ore:ingotIron>;

if(oreDictEnt in <minecraft:iron_ingot>){
    print("Iron is in the oreDic!");

if(oreDictEnt has <minecraft:iron_ingot>){
    print("Iron still is in the oreDic!");

Mirror an IOreDictEntry

Mirroring an IOreDictEntry means that all items in the other oreDictEntry will be replaced by the items in the oreDictEntry the method was executed on:

//make iron and copper equivalent
val iron = <ore:ingotIron>;
val copper = <ore:ingotCopper>;

//adds all entries from iron to copper so that Copper contains both, the iron and copper oreDic entries

//mirrors copper to iron, so all items in iron will be replaced by all the ones in copper.
//In this case that means by all iron and copper oreDictEntries

IIngredient implementation

IOreDictEntry extends IIngredient. This means that all methods available to IIngredient are also available to IOreDictEntries. It also means that you can put IOreDictEntries into IIngredient Arrays (such as the ones in crafting recipe methods).

Iterating through an oreDictEntry’s items

val iron = <ore:ingotIron>;

for item in iron.items{