Interface ResourceCondition


public interface ResourceCondition
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<ResourceCondition> CODEC
      A codec for a resource condition. It is a map with a condition key denoting the ID of the condition, and any additional values required by the specific condition.
    • LIST_CODEC

      static final com.mojang.serialization.Codec<List<ResourceCondition>> LIST_CODEC
      A codec for a list of conditions.
  • Method Details

    • getType

      ResourceConditionType<?> getType()
      Returns:
      the type of the condition
    • test

      boolean test(@Nullable RegistryWrapper.WrapperLookup registryLookup)
      Tests the condition. The passed registry lookup, if any, includes all static and dynamic entries. However, the tags are not loaded yet.
      Parameters:
      registryLookup - the registry lookup, or null in case registry is unavailable
      Returns:
      whether the condition was successful
      Implementation Note:
      registryLookup should never be null for supported use cases (such as recipes or advancements). However, it may be null in client-side resources, or for non-vanilla resource types.