Record Class SpotAnimEvent
java.lang.Object
java.lang.Record
com.botwithus.bot.api.event.SpotAnimEvent
- Record Components:
targetServerIndex- entity server slot, or-1for world/statictargetType-0 = player,1 = npc,2 = worldspotAnimId- the spot anim (graphic) idtileX- tile X (entity's, or the world graphic's) when it startedtileY- tile Y (entity's, or the world graphic's) when it startedplane- plane (0..3)timestamp- event creation time in milliseconds since epoch
- All Implemented Interfaces:
GameEvent
public record SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp)
extends Record
implements GameEvent
Fired when a new spot animation (graphic) starts playing. The producer emits
one event per newly-started spot anim (edge-triggered — it does not re-fire
while a spot anim persists across ticks). Two flavours share this event:
- Entity-attached (
targetType0 = player/1 = npc): the graphic plays on an NPC/player, walked from that entity's graph-node children.targetServerIndexis the entity's server slot;tileX/tileY/planeare its tile when the spot anim started. An entity can play several at once; the per-entity snapshot field surfaces only the first, so this event is the way to observe every one. - World/static (
targetType == 2,targetServerIndex == -1): the graphic plays on a tile with no entity (spell splashes, AoE effects, ground sparkles), walked from the worldSpotAnimList.tileX/tileYare the graphic's world tile;planeis the local player's plane (the active render level). UseisWorldAnchored()to distinguish these.
-
Constructor Summary
ConstructorsConstructorDescriptionSpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane) SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp) Creates an instance of aSpotAnimEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanTrue for a world/static spot anim — one playing on a tile with no entity (targetServerIndex == -1, equivalentlytargetType == 2).intplane()Returns the value of theplanerecord component.intReturns the value of thespotAnimIdrecord component.intReturns the value of thetargetServerIndexrecord component.intReturns the value of thetargetTyperecord component.inttileX()Returns the value of thetileXrecord component.inttileY()Returns the value of thetileYrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SpotAnimEvent
public SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane) -
SpotAnimEvent
public SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp) Creates an instance of aSpotAnimEventrecord class.- Parameters:
targetServerIndex- the value for thetargetServerIndexrecord componenttargetType- the value for thetargetTyperecord componentspotAnimId- the value for thespotAnimIdrecord componenttileX- the value for thetileXrecord componenttileY- the value for thetileYrecord componentplane- the value for theplanerecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
isWorldAnchored
public boolean isWorldAnchored()True for a world/static spot anim — one playing on a tile with no entity (targetServerIndex == -1, equivalentlytargetType == 2). For these,tileX/tileYcarry the graphic's world tile. -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
targetServerIndex
public int targetServerIndex()Returns the value of thetargetServerIndexrecord component.- Returns:
- the value of the
targetServerIndexrecord component
-
targetType
public int targetType()Returns the value of thetargetTyperecord component.- Returns:
- the value of the
targetTyperecord component
-
spotAnimId
public int spotAnimId()Returns the value of thespotAnimIdrecord component.- Returns:
- the value of the
spotAnimIdrecord component
-
tileX
-
tileY
-
plane
-
timestamp
-