Package dev.latvian.mods.kubejs.item
Record Class ItemBehavior.HurtEnemyContext
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.item.ItemBehavior.HurtEnemyContext
- Enclosing class:
ItemBehavior
public static record ItemBehavior.HurtEnemyContext(net.minecraft.world.item.ItemStack getItem, net.minecraft.world.entity.LivingEntity getTarget, net.minecraft.world.entity.LivingEntity getAttacker)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionHurtEnemyContext(net.minecraft.world.item.ItemStack getItem, net.minecraft.world.entity.LivingEntity getTarget, net.minecraft.world.entity.LivingEntity getAttacker) Creates an instance of aHurtEnemyContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.entity.LivingEntityReturns the value of thegetAttackerrecord component.net.minecraft.world.item.ItemStackgetItem()Returns the value of thegetItemrecord component.net.minecraft.world.entity.LivingEntityReturns the value of thegetTargetrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HurtEnemyContext
public HurtEnemyContext(net.minecraft.world.item.ItemStack getItem, net.minecraft.world.entity.LivingEntity getTarget, net.minecraft.world.entity.LivingEntity getAttacker) Creates an instance of aHurtEnemyContextrecord class.- Parameters:
getItem- the value for thegetItemrecord componentgetTarget- the value for thegetTargetrecord componentgetAttacker- the value for thegetAttackerrecord component
-
-
Method Details
-
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. -
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. -
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
getItem
public net.minecraft.world.item.ItemStack getItem()Returns the value of thegetItemrecord component.- Returns:
- the value of the
getItemrecord component
-
getTarget
public net.minecraft.world.entity.LivingEntity getTarget()Returns the value of thegetTargetrecord component.- Returns:
- the value of the
getTargetrecord component
-
getAttacker
public net.minecraft.world.entity.LivingEntity getAttacker()Returns the value of thegetAttackerrecord component.- Returns:
- the value of the
getAttackerrecord component
-