QcItemDrop Struct
An item that a block (or other content) drops, with count, chance and conditions. More...
| Header: | #include <common/content/blocks/QcBlockDefinition.h> |
Public Functions
| int | mostCount() const |
Public Variables
Related Non-Members
| QcBlockId | |
| enum class | QcBlockSoundAction { Break, Place, Step, Hit } |
| enum class | QcBlockSupport { None, Below, Attached } |
| enum class | QcFacingRule { Away, Toward, Into, Against } |
| enum class | QcRailAction { None, Boost, Activate } |
| enum class | QcRenderLayer { Invisible, Opaque, Cutout, Translucent } |
| const QcBlockId | qcAirBlockId |
| const int | qcBlockSoundActionCount |
Detailed Description
Member Function Documentation
int QcItemDrop::mostCount() const
Returns the most items this drop gives.
Member Variable Documentation
double QcItemDrop::chance
Probability in [0, 1] that this drop appears at all.
int QcItemDrop::count
Number of items dropped ("count", 1 to 64 for blocks).
QString QcItemDrop::item
Qualified name of the dropped item ("item").
int QcItemDrop::maxCount
More than count items, chosen evenly between count and this (lapis lazuli drops 4 to 9, a squid 1 to 3 ink sacs); 0 for exactly count. A later fortune enchantment raises it.
QList<QcShapeCondition> QcItemDrop::when
Block drops only: states that drop it (every condition holds); empty for all states. Server side only (crops drop their harvest only when ripe, decision E-289).
Related Non-Members
[alias] QcBlockId
Runtime block id: index into the registry, assigned at registration. Never persisted; persistent data refers to blocks by name.
enum class QcBlockSoundAction
What happens to a block when it makes a sound.
| Constant | Value | Description |
|---|---|---|
QcItemDrop::QcBlockSoundAction::Break | 0 | The block is broken. |
QcItemDrop::QcBlockSoundAction::Place | 1 | The block is placed. |
QcItemDrop::QcBlockSoundAction::Step | 2 | A body walks on the block. |
QcItemDrop::QcBlockSoundAction::Hit | 3 | Each strike while mining. |
enum class QcBlockSupport
What a block needs next to it to stay in place; without it, it breaks and drops.
| Constant | Value | Description |
|---|---|---|
QcItemDrop::QcBlockSupport::None | 0 | Needs nothing next to it. |
QcItemDrop::QcBlockSupport::Below | 1 | A full solid top face below (plants, floor torches). |
QcItemDrop::QcBlockSupport::Attached | 2 | A full solid face on the side its attach property names (torches, ladders). |
enum class QcFacingRule
How a placed block's facing follows the player's horizontal view direction.
| Constant | Value | Description |
|---|---|---|
QcItemDrop::QcFacingRule::Away | 0 | Facing where the player looks (stairs climb away, doors open away). |
QcItemDrop::QcFacingRule::Toward | 1 | Facing back at the player (furnace and chest fronts). |
QcItemDrop::QcFacingRule::Into | 2 | Facing into the clicked block (a hopper's spout); placed on top, down (decision E-342). |
QcItemDrop::QcFacingRule::Against | 3 | Towards the clicked block on a side face, where the player looks on the top or bottom (a vertical slab lying against the clicked block, decision E-755). |
enum class QcRailAction
What a rail does to the minecarts on it (decision E-384): a powered rail speeds them up while it is powered and brakes them while it is not; an activator rail acts on them while it is powered (the rider gets out, a hopper cart stops pulling) and lets a hopper cart pull again while it is not.
| Constant | Value | Description |
|---|---|---|
QcItemDrop::QcRailAction::None | 0 | A plain rail (\c {"railAction"} none or missing). |
QcItemDrop::QcRailAction::Boost | 1 | A powered rail (\c {"railAction": "boost"}). |
QcItemDrop::QcRailAction::Activate | 2 | An activator rail (\c {"railAction": "activate"}). |
enum class QcRenderLayer
Render pass of a block ("render": opaque, cutout, translucent or invisible).
Cross-shaped blocks default to cutout, all others to opaque.
| Constant | Value | Description |
|---|---|---|
QcItemDrop::QcRenderLayer::Invisible | 0 | Not drawn at all (air). |
QcItemDrop::QcRenderLayer::Opaque | 1 | Drawn in the opaque pass without transparency. |
QcItemDrop::QcRenderLayer::Cutout | 2 | Alpha-tested (e.g. leaves): drawn in the opaque pass, does not hide neighbour faces. |
QcItemDrop::QcRenderLayer::Translucent | 3 | Alpha-blended (e.g. water, glass). |
const QcBlockId qcAirBlockId
Id of air, the one block the registry defines itself and the empty value of chunk storage.
const int qcBlockSoundActionCount
Number of values of QcBlockSoundAction.