LootContextParamSets

Link to lootcontextparamsets

These are pre-registered param sets that are used by vanilla.

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.param.LootContextParamSets;

Link to advancementEntity

Name: advancementEntity

Gets the 'advancement_entity' param set.

The 'advancement_entity' param set requires the following params:


  • this_entity

  • origin

Returns: The 'advancement_entity' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.advancementEntity() as LootContextParamSet

LootContextParamSets.advancementEntity();

Link to advancementReward

Name: advancementReward

Gets the 'advancement_reward' param set.

The 'advancement_reward' param set requires the following params:


  • this_entity

  • origin

Returns: The 'advancement_reward' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.advancementReward() as LootContextParamSet

LootContextParamSets.advancementReward();

Name: allParams

Gets the 'generic' param set.

The 'generic' param set requires the following params:


  • this_entity

  • last_damage_player

  • damage_source

  • killer_entity

  • direct_killer_entity

  • origin

  • block_state

  • block_entity

  • tool

  • explosion_radius

Returns: The 'generic' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.allParams() as LootContextParamSet

LootContextParamSets.allParams();

Name: block

Gets the 'block' param set.

The 'block' param set requires the following params:


  • block_state

  • origin

  • tool



The 'block' param set can optionally use:

  • this_entity

  • block_entity

  • explosion_radius

Returns: The 'block' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.block() as LootContextParamSet

LootContextParamSets.block();

Name: chest

Gets the 'chest' param set.

The 'chest' param set requires the following params:


  • origin



The 'chest' param set can optionally use:

  • this_entity

Returns: The 'chest' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.chest() as LootContextParamSet

LootContextParamSets.chest();

Name: command

Gets the 'command' param set.

The 'command' param set requires the following params:


  • origin



The 'command' param set can optionally use:

  • this_entity

Returns: The 'command' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.command() as LootContextParamSet

LootContextParamSets.command();

Name: empty

Gets the 'empty' param set.

Returns: The 'empty' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.empty() as LootContextParamSet

LootContextParamSets.empty();

Name: entity

Gets the 'entity' param set.

The 'entity' param set requires the following params:


  • this_entity

  • origin

  • damage_source



The 'entity' param set can optionally use:

  • killer_entity

  • direct_killer_entity

  • last_damage_player

Returns: The 'entity' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.entity() as LootContextParamSet

LootContextParamSets.entity();

Name: fishing

Gets the 'fishing' param set.

The 'fishing' param set requires the following params:


  • origin

  • tool



The 'fishing' param set can optionally use:

  • this_entity

Returns: The 'fishing' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.fishing() as LootContextParamSet

LootContextParamSets.fishing();

Name: get

Gets a param set from its name.

Will throw an exception if no param set is registered for the given name.

Returns: The found param set or an exception if not registered.
Return Type: LootContextParamSet

ZenScript
Copy
LootContextParamSets.get(name as ResourceLocation) as LootContextParamSet
ParameterTypeDescription
Parameter
name
Type
ResourceLocation
Description
The name of the param.

Name: gift

Gets the 'gift' param set.

The 'gift' param set requires the following params:


  • origin

  • this_entity

Returns: The 'gift' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.gift() as LootContextParamSet

LootContextParamSets.gift();

Name: piglinBarter

Gets the 'barter' param set.

The 'barter' param set requires the following params:


  • this_entity

Returns: The 'barter' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.piglinBarter() as LootContextParamSet

LootContextParamSets.piglinBarter();

Name: selector

Gets the 'selector' param set.

The 'selector' param set requires the following params:


  • origin

  • this_entity

Returns: The 'selector' param set.
Return Type: LootContextParamSet

ZenScript
Copy
// LootContextParamSets.selector() as LootContextParamSet

LootContextParamSets.selector();