Package commoble.looot.loot

# Class ApplyFunctionsIfTagged

java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
commoble.looot.loot.ApplyFunctionsIfTagged

All Implemented Interfaces:
  `BiFunction<net.minecraft.world.item.ItemStack,net.minecraft.world.level.storage.loot.LootContext,net.minecraft.world.item.ItemStack>`, `net.minecraft.world.level.storage.loot.functions.LootItemFunction`, `net.minecraft.world.level.storage.loot.LootContextUser`

public class ApplyFunctionsIfTagged extends net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
let's say we want to run one or more loot functions if a generated item belongs to an itemtag
this can't be done by the vanilla loot conditions or functions, so it's a good candidate for making a new feature
unfortunately, loot conditions can't observe the itemstack itself, so we have to write the condition as a loot function instead

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ApplyFunctionsIfTagged.Serializer`

## Nested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

`net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<T extends net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<T>>`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`FUNCTIONS_KEY`
`static final String`
`ID`
`static final String`
`TAG_KEY`
`static final net.minecraft.world.level.storage.loot.functions.LootItemFunctionType`
`TYPE`

### Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

`predicates`

## Constructor Summary

Constructors
Constructor
Description
`ApplyFunctionsIfTagged(net.minecraft.world.level.storage.loot.predicates.LootItemCondition[] conditions, net.minecraft.resources.ResourceLocation tagName, net.minecraft.world.level.storage.loot.functions.LootItemFunction[] subFunctions)`

## Method Summary

Modifier and Type
Method
Description
`static net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<?>`
`getBuilder(net.minecraft.resources.ResourceLocation tag, net.minecraft.world.level.storage.loot.functions.LootItemFunction... subFunctions)`
`net.minecraft.world.level.storage.loot.functions.LootItemFunctionType`
`getType()`
`protected net.minecraft.world.item.ItemStack`
`run(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context)`

### Methods inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

`apply, simpleBuilder, validate`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.BiFunction

`andThen`

### Methods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser

`getReferencedContextParams`

## Field Details

### ID

public static final String ID

See Also:
  - Constant Field Values

### TAG_KEY

public static final String TAG_KEY

See Also:
  - Constant Field Values

### FUNCTIONS_KEY

public static final String FUNCTIONS_KEY

See Also:
  - Constant Field Values

### TYPE

public static final net.minecraft.world.level.storage.loot.functions.LootItemFunctionType TYPE

## Constructor Details

### ApplyFunctionsIfTagged

public ApplyFunctionsIfTagged(net.minecraft.world.level.storage.loot.predicates.LootItemCondition[] conditions, net.minecraft.resources.ResourceLocation tagName, net.minecraft.world.level.storage.loot.functions.LootItemFunction[] subFunctions)

## Method Details

### getType

public net.minecraft.world.level.storage.loot.functions.LootItemFunctionType getType()

### run

protected net.minecraft.world.item.ItemStack run(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context)

Specified by:
  `run` in class `net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction`

### getBuilder

public static net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<?> getBuilder(net.minecraft.resources.ResourceLocation tag, net.minecraft.world.level.storage.loot.functions.LootItemFunction... subFunctions)