Class MatchToolCondition

java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootCondition
com.github.darksoulq.abyssallib.world.data.loot.condition.MatchToolCondition

public class MatchToolCondition extends LootCondition
A loot condition that evaluates to true if the tool used in the generation context matches a specific material.

This is primarily used for block-break loot tables where specific items should only drop when harvested with a specific tool (e.g., Shears for leaves).

  • Field Details

    • CODEC

      public static final Codec<MatchToolCondition> CODEC
      The codec used for serializing and deserializing the match tool condition.

      It maps the "item" field to a string representation of a Material.

    • TYPE

      public static final LootConditionType<MatchToolCondition> TYPE
      The registered type definition for the match tool loot condition.
  • Constructor Details

    • MatchToolCondition

      public MatchToolCondition(org.bukkit.Material item)
      Constructs a new MatchToolCondition for the specified material.
      Parameters:
      item - The Material to match against the context tool.
  • Method Details