Class LootCondition
java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootCondition
- Direct Known Subclasses:
KilledByPlayerCondition, LocationCheckCondition, MatchToolCondition, RandomChanceCondition, RandomChanceWithLootingCondition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<LootCondition> Polymorphic codec for serializing and deserializing loot conditions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract LootConditionType<?> getType()Retrieves the specific type definition associated with this condition instance.abstract booleantest(LootContext context) Evaluates this condition against the provided loot context.
-
Field Details
-
CODEC
Polymorphic codec for serializing and deserializing loot conditions.Decodes the condition by identifying the "type" field via
Registries.LOOT_CONDITIONSand delegating to the specific type's internal codec.
-
-
Constructor Details
-
LootCondition
public LootCondition()
-
-
Method Details
-
test
Evaluates this condition against the provided loot context.- Parameters:
context- TheLootContextcontaining environment and entity data.- Returns:
trueif the condition is met;falseotherwise.
-
getType
Retrieves the specific type definition associated with this condition instance.- Returns:
- The
LootConditionTypeused for registry identification and serialization.
-