Skip to main content

BlockPlacePacket

class

Declaration​

[ProtocolSupport(735, 777)]
[Packet("play.toServer.block_place", PacketPhase.Play, PacketDirection.Serverbound)]
[PacketField("Hand", "int")]
[PacketField("Location", "Position")]
[PacketField("Direction", "int")]
[PacketField("CursorX", "float")]
[PacketField("CursorY", "float")]
[PacketField("CursorZ", "float")]
[PacketField("InsideBlock", "bool")]
[PacketField("Sequence", "int", Group = "V759_767", From = 759, To = 767)]
[PacketField("WorldBorderHit", "bool", Group = "V768_Last", From = 768)]
[PacketField("Sequence", "int", Group = "V768_Last", From = 768)]
public sealed record BlockPlacePacket : IPacket<BlockPlacePacket>, IProtocolType<BlockPlacePacket>, IPacket
NamespaceMcProtoNet.Protocol.Packets.Play.Serverbound
AssemblyMcProtoNet.Protocol.dll
Sourcesrc/McProtoNet.Protocol/Generated/Packets/Play/Serverbound/BlockPlacePacket.cs#L6 ↗

Implements: IPacket<BlockPlacePacket>, IProtocolType<BlockPlacePacket>, IPacket

Constructors​

SignatureDescription
BlockPlacePacket(int Hand, Position Location, int Direction, float CursorX, float CursorY, float CursorZ, bool InsideBlock, BlockPlacePacket.V759_767Layer? V759_767 = null, BlockPlacePacket.V768_LastLayer? V768_Last = null)-

BlockPlacePacket(int, Position, int, float, float, float, bool, V759_767Layer?, V768_LastLayer?)​

public BlockPlacePacket(int Hand, Position Location, int Direction, float CursorX, float CursorY, float CursorZ, bool InsideBlock, BlockPlacePacket.V759_767Layer? V759_767 = null, BlockPlacePacket.V768_LastLayer? V768_Last = null)

Parameters: Hand (int), Location (Position), Direction (int), CursorX (float), CursorY (float), CursorZ (float), InsideBlock (bool), V759_767 (BlockPlacePacket.V759_767Layer?), V768_Last (BlockPlacePacket.V768_LastLayer?)

Properties​

SignatureDescription
float CursorX-
float CursorY-
float CursorZ-
int Direction-
int Hand-
static PacketIdentity IdentityGets the identity of the packet type.
bool InsideBlock-
Position Location-
BlockPlacePacket.V759_767Layer? V759_767-
BlockPlacePacket.V768_LastLayer? V768_Last-

CursorX​

public float CursorX { get; init; }

Returns: float

CursorY​

public float CursorY { get; init; }

Returns: float

CursorZ​

public float CursorZ { get; init; }

Returns: float

Direction​

public int Direction { get; init; }

Returns: int

Hand​

public int Hand { get; init; }

Returns: int

Identity​

public static PacketIdentity Identity { get; }

Gets the identity of the packet type.

Returns: PacketIdentity

InsideBlock​

public bool InsideBlock { get; init; }

Returns: bool

Location​

public Position Location { get; init; }

Returns: Position

V759_767​

public BlockPlacePacket.V759_767Layer? V759_767 { get; init; }

Returns: BlockPlacePacket.V759_767Layer?

V768_Last​

public BlockPlacePacket.V768_LastLayer? V768_Last { get; init; }

Returns: BlockPlacePacket.V768_LastLayer?

Methods​

SignatureDescription
static int GetPacketId(int protocolVersion)-
static BlockPlacePacket Read(ref MinecraftPrimitiveReader reader, int protocolVersion)Reads a value of type BlockPlacePacket 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 (int)

Returns: int

Read(ref MinecraftPrimitiveReader, int)​

public static BlockPlacePacket Read(ref MinecraftPrimitiveReader reader, int protocolVersion)

Reads a value of type BlockPlacePacket from the specified reader.

Parameters: reader (MinecraftPrimitiveReader), protocolVersion (int)

Returns: BlockPlacePacket - 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 (int), id (int)

Returns: bool - true if the packet exists on the specified protocol version; otherwise, false.

Write(MinecraftPrimitiveWriter, int)​

public void Write(MinecraftPrimitiveWriter writer, int protocolVersion)

Writes the current value to the specified writer.

Parameters: writer (MinecraftPrimitiveWriter), protocolVersion (int)