java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.world.level.loot.number_providers.EntityKillersValue
All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser, net.minecraft.world.level.storage.loot.providers.number.NumberProvider

public record EntityKillersValue() extends Record implements net.minecraft.world.level.storage.loot.providers.number.NumberProvider
Rolls are based on the number of entities that attacked the entity dropping loot.

Entities using this loot table must implement AttackerTracker, otherwise this will do nothing.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<EntityKillersValue>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a EntityKillersValue record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    equals(Object pOther)
    Indicates whether some other object is "equal to" this one.
    float
    getFloat(net.minecraft.world.level.storage.loot.LootContext lootContext)
     
    net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType
     
    int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

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

    getReferencedContextParams, validate

    Methods inherited from interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider

    getInt
  • Field Details

  • Constructor Details

    • EntityKillersValue

      public EntityKillersValue()
      Creates an instance of a EntityKillersValue record class.
  • Method Details

    • getType

      public net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType getType()
      Specified by:
      getType in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • getFloat

      public float getFloat(net.minecraft.world.level.storage.loot.LootContext lootContext)
      Specified by:
      getFloat in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • create

      public static EntityKillersValue create()
    • equals

      public boolean equals(Object pOther)
      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.
      Specified by:
      equals in class Record
      Parameters:
      pOther - the object with which to compare
      Returns:
      true if this object is the same as the pOther argument; false otherwise.
    • hashCode

      public 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
    • 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