Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

LootParams

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.loot.LootParams;

Members

addDynamicDrops(key as ResourceLocation, drop as function(t as ItemStack) as void)
script.zs
// LootParams.addDynamicDrops(key as ResourceLocation, drop as function(t as ItemStack) as void);
myLootParams.addDynamicDrops(myResourceLocation, myConsumer);

Parameters:

drop Type: function(t as ItemStack) as void
getOptionalParameter(param as LootContextParam<T>) as T?
script.zs
// LootParams.getOptionalParameter<T>(param as LootContextParam<T>) as T?;
myLootParams.getOptionalParameter<T>(myLootContextParam);

Parameters:

param Type: LootContextParam<T>

Return Type: T?

getParameter(param as LootContextParam<T>) as T
script.zs
// LootParams.getParameter<T>(param as LootContextParam<T>) as T;
myLootParams.getParameter<T>(myLootContextParam);

Parameters:

param Type: LootContextParam<T>

Return Type: T

getParamOrNull(param as LootContextParam<T>) as T?
script.zs
// LootParams.getParamOrNull<T>(param as LootContextParam<T>) as T?;
myLootParams.getParamOrNull<T>(myLootContextParam);

Parameters:

param Type: LootContextParam<T>

Return Type: T?

hasParam($$0 as LootContextParam<T>) as bool
script.zs
// LootParams.hasParam<T>($$0 as LootContextParam<T>) as bool;
myLootParams.hasParam<T>(myLootContextParam);

Parameters:

Return Type: bool

Getter
script.zs
// LootParams.level as ServerLevel
myLootParams.level

Return Type: ServerLevel

Getter
script.zs
// LootParams.luck as float
myLootParams.luck

Return Type: float