Class CanItemPerformAbility

java.lang.Object
net.neoforged.neoforge.common.loot.CanItemPerformAbility
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 CanItemPerformAbility extends Object implements net.minecraft.world.level.storage.loot.predicates.LootItemCondition
This LootItemCondition "neoforge:can_item_perform_ability" can be used to check if an item can perform a given ItemAbility.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.world.level.storage.loot.predicates.LootItemCondition

    net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final ItemAbility
     
    static com.mojang.serialization.MapCodec<CanItemPerformAbility>
     
    static final net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
     

    Fields inherited from interface net.minecraft.world.level.storage.loot.predicates.LootItemCondition

    DIRECT_CODEC, TYPED_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder
     
    Set<net.minecraft.util.context.ContextKey<?>>
     
    net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
     
    boolean
    test(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

    validate

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Field Details

    • CODEC

      public static com.mojang.serialization.MapCodec<CanItemPerformAbility> CODEC
    • LOOT_CONDITION_TYPE

      public static final net.minecraft.world.level.storage.loot.predicates.LootItemConditionType LOOT_CONDITION_TYPE
    • ability

      final ItemAbility ability
  • Constructor Details

    • CanItemPerformAbility

      public CanItemPerformAbility(ItemAbility ability)
  • Method Details

    • getType

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

      public Set<net.minecraft.util.context.ContextKey<?>> getReferencedContextParams()
      Specified by:
      getReferencedContextParams in interface net.minecraft.world.level.storage.loot.LootContextUser
    • test

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

      public static net.minecraft.world.level.storage.loot.predicates.LootItemCondition.Builder canItemPerformAbility(ItemAbility action)