Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.loot.LootParams;

Name: addDynamicDrops

ZenScript
Copy
LootParams.addDynamicDrops(key as ResourceLocation, drop as Consumer<ItemStack>)
ParameterType
Parameter
key
Type
ResourceLocation
Parameter
drop
Type
Consumer<ItemStack>

Link to getOptionalParameter

Name: getOptionalParameter

Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T

ZenScript
Copy
LootParams.getOptionalParameter<T : Object>(param as LootContextParam<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
param
Type
LootContextParam<T>
Parameter
T
Type
Object

Name: getParamOrNull

Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T

ZenScript
Copy
LootParams.getParamOrNull<T : Object>(param as LootContextParam<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
param
Type
LootContextParam<T>
Parameter
T
Type
Object

Name: getParameter

Return Type: T

ZenScript
Copy
LootParams.getParameter<T : Object>(param as LootContextParam<T>) as T
ParameterType
Parameter
param
Type
LootContextParam<T>
Parameter
T
Type
Object

Name: hasParam

Return Type: boolean

ZenScript
Copy
LootParams.hasParam<T : Object>(param as LootContextParam<T>) as boolean
ParameterType
Parameter
param
Type
LootContextParam<T>
Parameter
T
Type
Object
NameTypeHas GetterHas Setter
Name
level
Type
ServerLevel
Has Getter
true
Has Setter
false
Name
luck
Type
float
Has Getter
true
Has Setter
false