Skip to content

Ore Dictionary ​

Warning

Requires version 0.3.0+

GroovyScript also allows you to remove and add ore dictionaries to items and reload them.

Getting an ore dict ingredient ​

Ore dict ingredients can be used in any recipe that accepts IIngredient.

Example

groovy
ore('ingotCopper') // returns all copper ingots
ore('ingot*') // wildcards are also valid (returns all ingots)

Adding ore dicts ​

All three methods are do exactly the same thing.

Example

groovy
oreDict.add("amogus", item('minecraft:iron_ingot'))

item('minecraft:iron_ingot').addOreDict(ore('amogus'))

ore('amogus').add(item('minecraft:iron_ingot'))

Removing ore dicts ​

All three methods are do exactly the same thing.

Example

groovy
oreDict.remove("ingotIron", item('minecraft:iron_ingot'))

item('minecraft:iron_ingot').removeOreDict(ore('ingotIron'))

ore('ingotIron').remove(item('minecraft:iron_ingot'))

Other ​

You can get all items from an ore dict. Both ways do the same thing.

Example

groovy
oreDict.getItems('ingotIron')
oreDict['ingotIron']

Checking if an item is in an ore dictionary

Example

groovy
item('minecraft:iron_ingot') in ore('ingotIron') // returns true

Getting the first item from an ore dictionary

Example

groovy
ore('ingotIron').first
ore('ingotIron')[0]

Iterating over all items in an ore dictionary

Example

groovy
for (def ironIngot : ore('ingotIron')) {
    ...
}

贡献者

© 2024 CleanroomMC. All Rights Reserved.