NameFilteringRule
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.
import crafttweaker.api.recipe.replacement.type.NameFilteringRule;
Description
Filters recipes that match a specific pattern on their name. This acts as a less specialized version of ModsFilteringRule
as it allows custom matching on the entirety of a recipe's name as determined by Recipe#getId(), at the cost of some efficiency.
Implements
NameFilteringRule
implements the following interfaces:
IFilteringRule
,ITargetingFilter
Members
The names are matched exactly, in both namespace and path.
Returns: A rule carrying out what has been specified.
NameFilteringRule.anyOf(myString[]);
Parameters:
exactNames: string[]
Type: string[]
- The exact names to look for.
Return Type:
NameFilteringRule
The word is not matched exactly and word boundaries aren't considered. This means that if a recipe is called "minecraft:pumpkin_pie"
and the rule is set up to check "pump"
, that recipe will pass the check instead of failing it.
Returns: A rule carrying out exactly what has been specified.
NameFilteringRule.containing(myString);
Parameters:
contents: string
Type: string
- The contents to look for in the recipe's name.
Return Type:
NameFilteringRule
Returns: A rule carrying out what has been specified.
NameFilteringRule.regex(myString);
Parameters:
regex: string
Type: string
- The regular expression to use.
Return Type:
NameFilteringRule