LootContextBuilder
Creates a new LootContext using a builder style pattern.
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.
Static Methods
Return Type: LootContextBuilder
Parameter | Type |
---|---|
Parameter context | Type LootContext |
Creates a new builder with the given level.
Returns: A new builder.
Return Type: LootContextBuilder
Parameter | Type | Description |
---|---|---|
Parameter params | Type LootParams | Description The params the loot will be rolled with. |
Methods
Creates a new LootContext with the given LootContextParamSet.
The given LootContextParamSet is used to determine what values are required for the context to be used.
Returns: a new LootContext
Return Type: LootContext
Parameter | Type | Description | Optional |
---|---|---|---|
Parameter key | Type ResourceLocation | Description An optional random key used when no seed is provided. | Optional true |
Gets the level that this builder uses.
Returns: The level that this builder uses.
Return Type: ServerLevel
Supplies a seed to be passed into a new Random.
Returns: This builder for chaining purposes.
Return Type: LootContextBuilder
Parameter | Type | Description | Optional | Default Value |
---|---|---|---|---|
Parameter seed | Type long | Description The optional seed to use, defaults to 0 . | Optional true | Default Value 0 |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name level | Type ServerLevel | Has Getter true | Has Setter false | Description Gets the level that this builder uses. |