QtCraft API C++ classes QML types Handbook

QcServerCreatures Class

The creatures in the server tick (decision E-367): their behaviour and spawning (QcMobManager) with what they need to know about the players, the blows they deal to players, their ambient sounds and the damage of crammed cells (game rule maxEntityCramming, decision E-401), what villagers do to the world (QcServerVillagers, decision E-411), what creatures with traits do (QcCreatureTraits, decision E-460: blocks taken and placed, teleports), creatures hiding in blocks (QcInfestation, decision E-453), monster spawners (QcSpawnerRules, decision E-520), the guardians of structure zones (QcGuardians, decision E-591), creatures that crumble at water (QcCrumbling, decision E-593), creatures that drink to heal (QcMobDrinking, decision E-623) and families of parents and children (QcMobFamilies, decision E-839). More...

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

Public Functions

void announceTeleports()
const QcCrumbling &crumbling() const
const QcMobDrinking &drinking() const
const QcMobFamilies &families() const
const QcGuardians &guardians() const
void tick()

Static Public Members

const double ambientSeconds
const int crammingSoundsPerTick
const quint64 foeTicks

Detailed Description

Member Function Documentation

void QcServerCreatures::announceTeleports()

Shows the clients the creatures that teleported since the creatures' tick (projectiles and burning make them teleport too) at their new place in this tick (QcCreatureTraits).

const QcCrumbling &QcServerCreatures::crumbling() const

Returns the creatures that crumble at water.

const QcMobDrinking &QcServerCreatures::drinking() const

Returns the creatures that drink to heal.

const QcMobFamilies &QcServerCreatures::families() const

Returns the families of parents and children.

const QcGuardians &QcServerCreatures::guardians() const

Returns the guardians of structure zones (decision E-591).

void QcServerCreatures::tick()

Runs the creatures' tick: their minds, then what they did to the world and the players.

Member Variable Documentation

const double QcServerCreatures::ambientSeconds

A creature with an ambient sound makes it on average this often (seconds).

const int QcServerCreatures::crammingSoundsPerTick

Hurt and death sounds of cramming per tick at most (a farm crams hundreds at once).

const quint64 QcServerCreatures::foeTicks

How long what a player fought counts for the player's pets (QcServerClient::Foes), in ticks.