QtCraft API C++ classes QML types Handbook

QcMsg::UseItem Struct

struct QcMsg::UseItem

Client -> server: use the held item on a block face (places blocks, opens doors). More...

Header: #include <common/protocol/QcWorldMessages.h>

Public Types

struct View

Public Variables

QcBlockFace face
QcVec3 hit
quint32 sequence
QcBlockPos target
std::optional<QcMsg::UseItem::View> view

Detailed Description

hit is the point the player aimed at inside the target block (0..1 per axis); it picks slab halves and the like. sequence numbers the client's prediction of the placed block (decision E-853), 0 when it predicted nothing; the server answers it with a BlockAck. view is the view direction the client predicted the placement with; the server places with it (facing, stairs), without it with the view of the player's latest input.

Member Variable Documentation

QcBlockFace UseItem::face

The face of the target that was clicked.

QcVec3 UseItem::hit

The point aimed at inside the target (see the struct).

quint32 UseItem::sequence

The number of the client's prediction (see the struct).

QcBlockPos UseItem::target

The block the item is used on.

std::optional<QcMsg::UseItem::View> UseItem::view

The view direction of the prediction (see the struct).