Items and an empty answer
How much copper is in a block — and how "there is none of it" differs from "the question does not apply"
As its third argument sensor takes not only a property but also an item. The vault holds 220
copper and 15 graphite; there is no silicon at all, and a vault does not hold water in
principle.
Three answers to three similar questions:
| Asked | Answer | What it means |
|---|---|---|
@copper |
220 | the item is there, and here is how much |
@silicon |
0 | the item exists, but not here — zero means “none” |
@water |
null |
a vault does not hold liquids at all — the question does not apply |
The first item is an object
Section titled “The first item is an object”@firstItem gives not a count but the item itself: the same object as the constant @copper.
It is convenient to pass on — into ucontrol itemTake, into sensor as the next argument,
into print.
“First” means the one that has been in the block longest and has not run out, not the largest and not the first alphabetically. On a drill it is whatever it is mining.
What can be asked as an item
Section titled “What can be asked as an item”Any item and any liquid in the game: @copper, @graphite, @water, @cryofluid. The full
list is in the reference, along with a way to walk them
all by index.
Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.