QtCraft API C++ classes QML types Handbook

QcMobExchange::PlayerView Struct

struct QcMobExchange::PlayerView

What the mob logic needs to know about a player. More...

Header: #include <server/mobs/QcMobExchange.h>

Public Variables

bool alive
const QcStatusEffects *effects
quint32 entityId
QcItemId held
quint32 hurtBy
quint64 hurtTick
QString identity
QcVec3 look
QString name
QcVec3 position
bool seated
double speed
quint32 struck
quint64 struckTick
bool targetable

Detailed Description

Member Variable Documentation

bool PlayerView::alive

A living body in the world: creatures notice only these (a spectator has none, decision E-730), and only these keep creatures from despawning and monsters from spawning close by (decision E-836).

const QcStatusEffects *PlayerView::effects

Its status effects (an archer's choice of projectile, decision E-623); null for none known.

quint32 PlayerView::entityId

The player's entity id.

QcItemId PlayerView::held

The item in the player's hand (shy creatures).

QString PlayerView::identity

The persistent identity of the player (QcPetOwners::keyOf): tame creatures know their owner by it (decision E-480).

QcVec3 PlayerView::look

Where the player looks (a unit vector; zero for unknown): a look at a head provokes neutral creatures with a gaze (decision E-460).

QString PlayerView::name

Villages hold their grudges by name (QcGolemGrudges).

QcVec3 PlayerView::position

Where the player's feet are.

bool PlayerView::seated

Rides a minecart or drives a boat: the vehicle meets the creatures (decisions E-382, E-920), the player's body does not push them (decision E-882).

double PlayerView::speed

The player's horizontal speed in m/s (shy creatures).

bool PlayerView::targetable

Creatures leave invulnerable players (creative mode) alone.