LootModifierManager
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.
Description
Manager for loot modifiers. An instance of this manager can be obtained via the com.blamejared.crafttweaker.api.loot.LootManager
.
The main usage of this manager is for registering "global loot modifiers", also known as "loot modifiers" for short. A global loot modifier runs on the loot drop of every loot table (unless otherwise specified by conditions) and is as such able to modify it according either to predetermined parameters (e.g. replacing items) or via completely customized code that leverages the dropping context.
For more information, refer to ILootModifier
.
Members
Returns: A list containing all currently registered loot modifiers.
Return Type:
List<ILootModifier>
Returns: A list with all the names of the currently registered loot modifiers.
Return Type:
List<ResourceLocation>
If no loot modifier with that name exists, a default no-op instance is returned.
Returns: The ILootModifier
with the given name, or a default one if no such instance exists.
Parameters:
name: string
Type: string
- The name of the loot modifier.
Return Type:
ILootModifier
The loot modifier will be run only when the given set of conditions is satisfied.
Parameters:
name: string
Type: string
- The unique identifier for the loot modifier. It must be all lowercase and devoid of both spaces andcolons.
conditions: LootConditions
Type: LootConditions
- A set of conditions that restrict the context in which the loot modifier applies. modifier: ILootModifier
Type: ILootModifier
- The loot modifier itself. It may be created via CommonLootModifiers
. Parameters:
modId: string
Type: string
- The mod ID. The name may either contain a colon or not. If no colon is present, it is assumed that the loot modifier name is one of the modifiers that have been already registered in a script.
Parameters:
name: string
Type: string
- The name of the loot modifier to remove. The entire name is taken into consideration for the match, effectively matching the format of a ResourceLocation
.
Parameters:
regex: string
Type: string
- The regular expression to match.