QtCraft API C++ classes QML types Handbook

QcProjectile Struct

A projectile flying or stuck in a block (decision E-425); QcProjectileManager moves, sticks and ages them. More...

Header: #include <server/entities/QcProjectile.h>
Inherits: QcEntity

Public Variables

double age
double damageFactor
QcProjectilePickup pickup
float pitch
quint32 shooter
bool stuck
QcBlockPos stuckIn
quint32 stuckState
bool transient
QString type

Static Public Members

const QcEntityKind entityKind
enum class QcProjectilePickup { Item, Remove, Never }

Detailed Description

Its motion's velocity is the flight; yaw and pitch (degrees) point along it.

Member Variable Documentation

double QcProjectile::age

Seconds since it was shot, or since it stuck while stuck.

double QcProjectile::damageFactor

Damage of a hit is multiplied by this (a fully drawn bow: 1; later enchantments).

const QcEntityKind QcProjectile::entityKind

The kind of every entity of this type (QcEntity::as).

QcProjectilePickup QcProjectile::pickup

Whether a player may pick it up when it is stuck.

float QcProjectile::pitch

The pitch in degrees (up positive), along the flight.

quint32 QcProjectile::shooter

The entity that shot it (not saved): it does not hit its shooter while it leaves him.

bool QcProjectile::stuck

Whether it sticks in a block.

bool QcProjectile::transient

Never saved (a fishing rod's bobber, decision E-503): left out of the chunk's records (QcEntityRecords), so it goes with its chunk.

QString QcProjectile::type

Name of its QcProjectileDefinition.

Related Non-Members

enum class QcProjectilePickup

Whether a player may pick up a stuck projectile (decision E-425): as its item (shot from a survival player's ammunition), only to remove it (shot in creative mode, which used no item), or not at all (shot by a creature).

ConstantValueDescription
QcProjectile::QcProjectilePickup::Item0Picked up as its item.
QcProjectile::QcProjectilePickup::Remove1Picked up only to remove it.
QcProjectile::QcProjectilePickup::Never2Not picked up at all.