Record Class EntityKillersValue

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, net.minecraft.world.level.storage.loot.Validatable

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
    com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.storage.loot.providers.number.NumberProvider>
     
     
    boolean
    equals(Object other)
    Indicates whether some other object is "equal to" this one.
    float
    getFloat(net.minecraft.world.level.storage.loot.LootContext lootContext)
     
    int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class 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

    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<EntityKillersValue> MAP_CODEC
  • Constructor Details

    • EntityKillersValue

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

    • create

      public static EntityKillersValue create()
    • 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
    • codec

      public com.mojang.serialization.MapCodec<? extends net.minecraft.world.level.storage.loot.providers.number.NumberProvider> codec()
      Specified by:
      codec in interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
    • equals

      public boolean equals(Object other)
      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:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other 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