Record Class SpawnEntityPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.SpawnEntityPacket
- All Implemented Interfaces:
SendablePacket, ServerPacket, ServerPacket.Play
public record SpawnEntityPacket(int entityId, UUID uuid, EntityType type, Pos position, float headRot, int data, Vec velocity)
extends Record
implements ServerPacket.Play
-
Nested Class Summary
Nested classes/interfaces inherited from interface ServerPacket
ServerPacket.ComponentHolding, ServerPacket.Configuration, ServerPacket.Login, ServerPacket.Play, ServerPacket.Status -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpawnEntityPacket(int entityId, UUID uuid, EntityType type, Pos position, float headRot, int data, Vec velocity) Creates an instance of aSpawnEntityPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdata()Returns the value of thedatarecord component.intentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheadRot()Returns the value of theheadRotrecord component.position()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.uuid()Returns the value of theuuidrecord component.velocity()Returns the value of thevelocityrecord component.
-
Field Details
-
SERIALIZER
-
-
Constructor Details
-
SpawnEntityPacket
public SpawnEntityPacket(int entityId, UUID uuid, EntityType type, Pos position, float headRot, int data, Vec velocity) Creates an instance of aSpawnEntityPacketrecord class.- Parameters:
entityId- the value for theentityIdrecord componentuuid- the value for theuuidrecord componenttype- the value for thetyperecord componentposition- the value for thepositionrecord componentheadRot- the value for theheadRotrecord componentdata- the value for thedatarecord componentvelocity- the value for thevelocityrecord 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. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
headRot
public float headRot()Returns the value of theheadRotrecord component.- Returns:
- the value of the
headRotrecord component
-
data
public int data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
velocity
Returns the value of thevelocityrecord component.- Returns:
- the value of the
velocityrecord component
-