Record Class BotDamageEvent
java.lang.Object
java.lang.Record
com.soulfiremc.server.api.event.bot.BotDamageEvent
- Record Components:
connection- The bot connection instance.previousHealth- The health before the damage was taken.newHealth- The health after the damage was taken.damageAmount- The amount of damage taken (previousHealth - newHealth).
- All Implemented Interfaces:
SoulFireBotEvent, SoulFireEvent, SoulFireGlobalEvent, SoulFireInstanceEvent
public record BotDamageEvent(BotConnection connection, float previousHealth, float newHealth, float damageAmount)
extends Record
implements SoulFireBotEvent
This event is called when the bot takes damage (health decreases).
-
Constructor Summary
ConstructorsConstructorDescriptionBotDamageEvent(BotConnection connection, float previousHealth, float newHealth, float damageAmount) Creates an instance of aBotDamageEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconnectionrecord component.floatReturns the value of thedamageAmountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of thenewHealthrecord component.floatReturns the value of thepreviousHealthrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SoulFireBotEvent
instanceManagerMethods inherited from interface SoulFireInstanceEvent
soulFireServer
-
Constructor Details
-
BotDamageEvent
public BotDamageEvent(BotConnection connection, float previousHealth, float newHealth, float damageAmount) Creates an instance of aBotDamageEventrecord class.- Parameters:
connection- the value for theconnectionrecord componentpreviousHealth- the value for thepreviousHealthrecord componentnewHealth- the value for thenewHealthrecord componentdamageAmount- the value for thedamageAmountrecord component
-
-
Method Details
-
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. -
connection
Returns the value of theconnectionrecord component.- Specified by:
connectionin interfaceSoulFireBotEvent- Returns:
- the value of the
connectionrecord component
-
previousHealth
public float previousHealth()Returns the value of thepreviousHealthrecord component.- Returns:
- the value of the
previousHealthrecord component
-
newHealth
-
damageAmount
public float damageAmount()Returns the value of thedamageAmountrecord component.- Returns:
- the value of the
damageAmountrecord component
-