SpawnEntityPacket
class
Declaration
[ProtocolSupport(735, 776)]
[Packet("play.toClient.spawn_entity", PacketPhase.Play, PacketDirection.Clientbound)]
[PacketField("EntityId", "int")]
[PacketField("ObjectUuid", "Guid")]
[PacketField("Type", "int")]
[PacketField("X", "double")]
[PacketField("Y", "double")]
[PacketField("Z", "double")]
[PacketField("Pitch", "int")]
[PacketField("Yaw", "int")]
[PacketField("ObjectData", "int")]
[PacketField("VelocityX", "int", Group = "VUntil758", To = 758)]
[PacketField("VelocityY", "int", Group = "VUntil758", To = 758)]
[PacketField("VelocityZ", "int", Group = "VUntil758", To = 758)]
[PacketField("HeadPitch", "int", Group = "V759_772", From = 759, To = 772)]
[PacketField("VelocityX", "int", Group = "V759_772", From = 759, To = 772)]
[PacketField("VelocityY", "int", Group = "V759_772", From = 759, To = 772)]
[PacketField("VelocityZ", "int", Group = "V759_772", From = 759, To = 772)]
[PacketField("HeadPitch", "int", Group = "V773_Last", From = 773)]
[PacketField("Velocity", "LpVec3", Group = "V773_Last", From = 773)]
public sealed record SpawnEntityPacket : IPacket<SpawnEntityPacket>, IProtocolType<SpawnEntityPacket>, IPacket
| Namespace | McProtoNet.Protocol.Packets.Play.Clientbound |
| Assembly | McProtoNet.Protocol.dll |
| Source | src/McProtoNet.Protocol/Generated/Packets/Play/Clientbound/SpawnEntityPacket.cs#L6 ↗ |
Implements: IPacket<SpawnEntityPacket>, IProtocolType<SpawnEntityPacket>, IPacket
Constructors
SpawnEntityPacket(int, Guid, int, double, double, double, int, int, int, VUntil758Layer?, V759_772Layer?, V773_LastLayer?)
public SpawnEntityPacket(int EntityId, Guid ObjectUuid, int Type, double X, double Y, double Z, int Pitch, int Yaw, int ObjectData, SpawnEntityPacket.VUntil758Layer? VUntil758 = null, SpawnEntityPacket.V759_772Layer? V759_772 = null, SpawnEntityPacket.V773_LastLayer? V773_Last = null)
Parameters: EntityId (Int32), ObjectUuid (Guid), Type (Int32), X (Double), Y (Double), Z (Double), Pitch (Int32), Yaw (Int32), ObjectData (Int32), VUntil758 (Nullable<VUntil758Layer>), V759_772 (Nullable<V759_772Layer>), V773_Last (Nullable<V773_LastLayer>)
Properties
| Signature | Description |
|---|---|
int EntityId | - |
static PacketIdentity Identity | Gets the identity of the packet type. |
int ObjectData | - |
Guid ObjectUuid | - |
int Pitch | - |
int Type | - |
SpawnEntityPacket.V759_772Layer? V759_772 | - |
SpawnEntityPacket.V773_LastLayer? V773_Last | - |
SpawnEntityPacket.VUntil758Layer? VUntil758 | - |
double X | - |
double Y | - |
int Yaw | - |
double Z | - |
EntityId
public int EntityId { get; init; }
Returns: Int32
Identity
public static PacketIdentity Identity { get; }
Gets the identity of the packet type.
Returns: PacketIdentity
ObjectData
public int ObjectData { get; init; }
Returns: Int32
ObjectUuid
public Guid ObjectUuid { get; init; }
Returns: Guid
Pitch
public int Pitch { get; init; }
Returns: Int32
Type
public int Type { get; init; }
Returns: Int32
V759_772
public SpawnEntityPacket.V759_772Layer? V759_772 { get; init; }
Returns: Nullable<V759_772Layer>
V773_Last
public SpawnEntityPacket.V773_LastLayer? V773_Last { get; init; }
Returns: Nullable<V773_LastLayer>
VUntil758
public SpawnEntityPacket.VUntil758Layer? VUntil758 { get; init; }
Returns: Nullable<VUntil758Layer>
X
public double X { get; init; }
Returns: Double
Y
public double Y { get; init; }
Returns: Double
Yaw
public int Yaw { get; init; }
Returns: Int32
Z
public double Z { get; init; }
Returns: Double
Methods
| Signature | Description |
|---|---|
static int GetPacketId(int protocolVersion) | - |
static SpawnEntityPacket Read(ref MinecraftPrimitiveReader reader, int protocolVersion) | Reads a value of type SpawnEntityPacket from the specified reader. |
static bool TryGetPacketId(int protocolVersion, out int id) | Attempts to get the wire id of the packet for the specified protocol version. |
void Write(MinecraftPrimitiveWriter writer, int protocolVersion) | Writes the current value to the specified writer. |
GetPacketId(int)
public static int GetPacketId(int protocolVersion)
Parameters: protocolVersion (Int32)
Returns: Int32
Read(ref MinecraftPrimitiveReader, int)
public static SpawnEntityPacket Read(ref MinecraftPrimitiveReader reader, int protocolVersion)
Reads a value of type SpawnEntityPacket from the specified reader.
Parameters: reader (MinecraftPrimitiveReader), protocolVersion (Int32)
Returns: SpawnEntityPacket - The value that was read.
TryGetPacketId(int, out int)
public static bool TryGetPacketId(int protocolVersion, out int id)
Attempts to get the wire id of the packet for the specified protocol version.
Parameters: protocolVersion (Int32), id (Int32)
Returns: Boolean - <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the packet exists on the specified protocol version; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.
Write(MinecraftPrimitiveWriter, int)
public void Write(MinecraftPrimitiveWriter writer, int protocolVersion)
Writes the current value to the specified writer.
Parameters: writer (MinecraftPrimitiveWriter), protocolVersion (Int32)