HomeCommandsExamplesGetting Started With ScriptsGlobal Keywords
BracketDumpersBracketHandlersBracketValidatorsResourceLocationBracketHandler

LootParamsBuilder

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.LootParamsBuilder;

Members

build(params as LootContextParamSet) as LootParams
script.zs
// Builder.build(params as LootContextParamSet) as LootParams;
myBuilder.build(myLootContextParamSet);

Parameters:

Return Type: LootParams

static create(level as ServerLevel) as Builder
script.zs
// Builder.create(level as ServerLevel) as LootParamsBuilder;
LootParamsBuilder.create(myServerLevel);

Parameters:

level Type: ServerLevel

Return Type: LootParamsBuilder

getOptionalParameter(param as LootContextParam<T>) as T?
script.zs
// Builder.getOptionalParameter<T>(param as LootContextParam<T>) as T?;
myBuilder.getOptionalParameter<T>(myLootContextParam);

Parameters:

param Type: LootContextParam<T>

Return Type: T?

getParameter(param as LootContextParam<T>) as T
script.zs
// Builder.getParameter<T>(param as LootContextParam<T>) as T;
myBuilder.getParameter<T>(myLootContextParam);

Parameters:

param Type: LootContextParam<T>

Return Type: T

Getter
script.zs
// Builder.level as ServerLevel
myBuilder.level

Return Type: ServerLevel

withDynamicDrop(key as ResourceLocation, drop as DynamicDrop) as Builder
script.zs
// Builder.withDynamicDrop(key as ResourceLocation, drop as DynamicDrop) as LootParamsBuilder;
myBuilder.withDynamicDrop(myResourceLocation, myDynamicDrop);

Parameters:

Return Type: LootParamsBuilder

withLuck(luck as float) as Builder
script.zs
// Builder.withLuck(luck as float) as LootParamsBuilder;
myBuilder.withLuck(myFloat);

Parameters:

luck Type: float

Return Type: LootParamsBuilder

withOptionalParameter(param as LootContextParam<T>, value as T?) as Builder
script.zs
// Builder.withOptionalParameter<T>(param as LootContextParam<T>, value as T?) as LootParamsBuilder;
myBuilder.withOptionalParameter<T>(myLootContextParam, myT);

Parameters:

param Type: LootContextParam<T>
value Type: T?

Return Type: LootParamsBuilder

withParameter(param as LootContextParam<T>, value as T) as Builder
script.zs
// Builder.withParameter<T>(param as LootContextParam<T>, value as T) as LootParamsBuilder;
myBuilder.withParameter<T>(myLootContextParam, myT);

Parameters:

param Type: LootContextParam<T>
value Type: T

Return Type: LootParamsBuilder