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 Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested 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 Type
    Method
    Description
    static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder
    effect(@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.Builder
    effect(@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.Builder
    effect(@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.LootItemConditionType
     
    boolean
    test(@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, wait

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

    getReferencedContextParams, validate

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • 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 id
      strength - 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 id
      minStrength - the minimum (inclusive) required strength
      maxStrength - the maximum (exclusive) required strength
      Returns:
      the condition
    • getType

      @NotNull public @NotNull net.minecraft.world.level.storage.loot.predicates.LootItemConditionType getType()
      Specified by:
      getType in interface net.minecraft.world.level.storage.loot.predicates.LootItemCondition
    • test

      public boolean test(@NotNull @NotNull net.minecraft.world.level.storage.loot.LootContext lootContext)
      Specified by:
      test in interface Predicate<net.minecraft.world.level.storage.loot.LootContext>