Package com.minecolonies.api.loot
Class ResearchUnlocked
java.lang.Object
com.minecolonies.api.loot.ResearchUnlocked
- All Implemented Interfaces:
Predicate<net.minecraft.world.level.storage.loot.LootContext>,net.minecraft.world.level.storage.loot.LootContextUser,net.minecraft.world.level.storage.loot.predicates.LootItemCondition
public class ResearchUnlocked
extends Object
implements net.minecraft.world.level.storage.loot.predicates.LootItemCondition
Loot condition that checks whether the local colony has unlocked the specified research
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.level.storage.loot.predicates.LootItemCondition
net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Buildereffect(@NotNull net.minecraft.resources.ResourceLocation effectId) Creates a loot condition that is true when the given research effect is unlocked.static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Buildereffect(@NotNull net.minecraft.resources.ResourceLocation effectId, double strength) Creates a loot condition that is true when the given research effect is unlocked at the given strength or higher.static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Buildereffect(@NotNull net.minecraft.resources.ResourceLocation effectId, double minStrength, double maxStrength) Creates a loot condition that is true when the given research effect is unlocked and within the given strength range.@NotNull net.minecraft.world.level.storage.loot.predicates.LootItemConditionTypegetType()booleantest(@NotNull net.minecraft.world.level.storage.loot.LootContext lootContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Method Details
-
effect
public static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder effect(@NotNull @NotNull net.minecraft.resources.ResourceLocation effectId) Creates a loot condition that is true when the given research effect is unlocked.- Parameters:
effectId- the research effect id- Returns:
- the condition
-
effect
public static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder effect(@NotNull @NotNull net.minecraft.resources.ResourceLocation effectId, double strength) Creates a loot condition that is true when the given research effect is unlocked at the given strength or higher.- Parameters:
effectId- the research effect idstrength- the minimum required strength- Returns:
- the condition
-
effect
public static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder effect(@NotNull @NotNull net.minecraft.resources.ResourceLocation effectId, double minStrength, double maxStrength) Creates a loot condition that is true when the given research effect is unlocked and within the given strength range.- Parameters:
effectId- the research effect idminStrength- the minimum (inclusive) required strengthmaxStrength- the maximum (exclusive) required strength- Returns:
- the condition
-
getType
@NotNull public @NotNull net.minecraft.world.level.storage.loot.predicates.LootItemConditionType getType()- Specified by:
getTypein interfacenet.minecraft.world.level.storage.loot.predicates.LootItemCondition
-
test
public boolean test(@NotNull @NotNull net.minecraft.world.level.storage.loot.LootContext lootContext)
-