LootContextParams
These are pre-registered params that are used by vanilla.
You can also create your own using getOrCreate
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
Gets the ‘block_entity’ param.
Returns: The ‘block_entity’ param.
Return Type: LootContextParam<BlockEntity>
Gets the ‘block_state’ param.
Returns: The ‘block_state’ param.
Return Type: LootContextParam<BlockState>
Gets the ‘damage_source’ param.
Returns: The ‘damage_source’ param.
Return Type: LootContextParam<DamageSource>
Gets the ‘direct_killer_entity’ param.
Returns: The ‘direct_killer_entity’ param.
Return Type: LootContextParam<Entity>
Gets the ‘explosion_radius’ param.
Returns: The ‘explosion_radius’ param.
Return Type: LootContextParam<float?>
Gets or creates a new parameter with the given name, using the given type.
Returns: The parameter with the given name or a new parameter if there are no registered parameters with the name.
Return Type: LootContextParam<T>
Parameter | Type | Description |
---|---|---|
Parameter name | Type ResourceLocation | Description The name of the parameter. |
Parameter tClass | Type Class<T> | Description |
Parameter T | Type Object | Description The type that the parameter acts on. |
Gets the ‘killer_entity’ param.
Returns: The ‘killer_entity’ param.
Return Type: LootContextParam<Entity>
Gets the ‘last_damage_player’ parameter.
Returns: The ‘last_damage_player’ parameter.
Return Type: LootContextParam<Player>
Gets the ‘origin’ param.
Returns: The ‘origin’ param.
Return Type: LootContextParam<Vec3>
Gets the ‘this_entity’ parameter.
Returns: The ‘this_entity’ parameter.
Return Type: LootContextParam<Entity>
Gets the ‘tool’ param.
Returns: The ‘tool’ param.
Return Type: LootContextParam<ItemStack>