Record Class PoolTarget

java.lang.Object
java.lang.Record
net.darkhax.bookshelf.common.api.data.loot.PoolTarget
Record Components:
table - The id of the loot table to target.
index - The index of the pool within the loot table. This is usually based on the order pools appear in the JSON data.
hash - A hash of the pools JSON data. This can be obtained using the bookshelf debug command in a development environment.

public record PoolTarget(net.minecraft.resources.ResourceLocation table, int index, int hash) extends Record
Represents a specific loot pool target within a loot table. This class also provides predefined constants for some of the commonly modified loot pools.
  • Field Details

    • MINESHAFT_RARE

      public static final PoolTarget MINESHAFT_RARE
    • MINESHAFT_UNCOMMON

      public static final PoolTarget MINESHAFT_UNCOMMON
    • MINESHAFT_COMMON

      public static final PoolTarget MINESHAFT_COMMON
    • SIMPLE_DUNGEON_RARE

      public static final PoolTarget SIMPLE_DUNGEON_RARE
    • SIMPLE_DUNGEON_UNCOMMON

      public static final PoolTarget SIMPLE_DUNGEON_UNCOMMON
    • SIMPLE_DUNGEON_COMMON

      public static final PoolTarget SIMPLE_DUNGEON_COMMON
    • CAT_GIFT

      public static final PoolTarget CAT_GIFT
    • FISHING

      public static final PoolTarget FISHING
    • FISHING_FISH

      public static final PoolTarget FISHING_FISH
    • FISHING_JUNK

      public static final PoolTarget FISHING_JUNK
    • FISHING_TREASURE

      public static final PoolTarget FISHING_TREASURE
    • PIGLIN_BARTERING

      public static final PoolTarget PIGLIN_BARTERING
    • SNIFFER_DIGGING

      public static final PoolTarget SNIFFER_DIGGING
    • ARCHAEOLOGY_PYRAMID

      public static final PoolTarget ARCHAEOLOGY_PYRAMID
    • ARCHAEOLOGY_DESERT_WELL

      public static final PoolTarget ARCHAEOLOGY_DESERT_WELL
    • ARCHAEOLOGY_OCEAN_RUIN_COLD

      public static final PoolTarget ARCHAEOLOGY_OCEAN_RUIN_COLD
    • ARCHAEOLOGY_OCEAN_RUIN_WARM

      public static final PoolTarget ARCHAEOLOGY_OCEAN_RUIN_WARM
    • ARCHAEOLOGY_TRAIL_RUINS_COMMON

      public static final PoolTarget ARCHAEOLOGY_TRAIL_RUINS_COMMON
    • ARCHAEOLOGY_TRAIL_RUINS_RARE

      public static final PoolTarget ARCHAEOLOGY_TRAIL_RUINS_RARE
  • Constructor Details

    • PoolTarget

      public PoolTarget(net.minecraft.resources.ResourceLocation table, int index, int hash)
      Creates an instance of a PoolTarget record class.
      Parameters:
      table - the value for the table record component
      index - the value for the index record component
      hash - the value for the hash record component
  • Method Details

    • of

      public static PoolTarget of(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table, int index, int hash)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • table

      public net.minecraft.resources.ResourceLocation table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • hash

      public int hash()
      Returns the value of the hash record component.
      Returns:
      the value of the hash record component