Record Class CombatEvent.Damage
java.lang.Object
java.lang.Record
cromveil.combatnumbers.events.CombatEvent.Damage
- All Implemented Interfaces:
CombatEvent
- Enclosing interface:
CombatEvent
public static record CombatEvent.Damage(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float rawDamage, float finalDamage, Set<net.minecraft.resources.Identifier> flags)
extends Record
implements CombatEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface CombatEvent
CombatEvent.Damage, CombatEvent.Heal -
Field Summary
Fields inherited from interface CombatEvent
DAMAGE_KIND, GENERIC_HEAL, HEAL_KIND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.entity.LivingEntityentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of thefinalDamagerecord component.Set<net.minecraft.resources.Identifier> flags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.Identifierkind()floatReturns the value of therawDamagerecord component.net.minecraft.world.damagesource.DamageSourcesource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.Optional<net.minecraft.resources.Identifier> typeKey()floatvalue()
-
Constructor Details
-
Damage
public Damage(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float rawDamage, float finalDamage, Set<net.minecraft.resources.Identifier> flags) Creates an instance of aDamagerecord class.- Parameters:
entity- the value for theentityrecord componentsource- the value for thesourcerecord componentrawDamage- the value for therawDamagerecord componentfinalDamage- the value for thefinalDamagerecord componentflags- the value for theflagsrecord component
-
-
Method Details
-
kind
public net.minecraft.resources.Identifier kind()- Specified by:
kindin interfaceCombatEvent
-
value
public float value()- Specified by:
valuein interfaceCombatEvent
-
typeKey
- Specified by:
typeKeyin interfaceCombatEvent
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entity
public net.minecraft.world.entity.LivingEntity entity()Returns the value of theentityrecord component.- Specified by:
entityin interfaceCombatEvent- Returns:
- the value of the
entityrecord component
-
source
public net.minecraft.world.damagesource.DamageSource source()Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
rawDamage
public float rawDamage()Returns the value of therawDamagerecord component.- Returns:
- the value of the
rawDamagerecord component
-
finalDamage
public float finalDamage()Returns the value of thefinalDamagerecord component.- Returns:
- the value of the
finalDamagerecord component
-
flags
Returns the value of theflagsrecord component.- Specified by:
flagsin interfaceCombatEvent- Returns:
- the value of the
flagsrecord component
-