ModsFilteringRule

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.recipe.replacement.type.ModsFilteringRule;

Description

Filters recipes that have been created by the given set of mods.

Every mod is identified according to its mod id. Recipes have been created by a mod if their name as determined by Recipe#getId() has that mod id as the namespace.

Implements

ModsFilteringRule implements the following interfaces:

IFilteringRule,ITargetingFilter

Members

static of(modIds as string[]) as IFilteringRule
Creates a new rule filtering recipes based on the given mod ids.

Returns: A rule carrying out what has been specified.

script.zs
// ModsFilteringRule.of(modIds as string[]) as IFilteringRule;
ModsFilteringRule.of(myString[]);

Parameters:

modIds Type: string[] - The mod ids to check for.

Return Type: IFilteringRule

static of(mods as Mod[]) as IFilteringRule
Creates a new rule filtering recipes based on the ids of the given Mods.

Returns: A rule carrying out what has been specified.

script.zs
// ModsFilteringRule.of(mods as Mod[]) as IFilteringRule;
ModsFilteringRule.of(myMod[]);

Parameters:

mods Type: Mod[] - The mods to check for.

Return Type: IFilteringRule