October 2014
Beginner to intermediate
285 pages
6h 24m
English

if statements decide what to run based on whether something is true. But just what is true?
Besides numbers and strings that we’ve seen, you can also make a variable that keeps track of whether something is turned on, like a toggle switch. In Minecraft, we’ll use this to determine all sorts of things: if a player is on the ground or not, if a string matches another string, whether to use a game event or ignore it, and much more.
Java calls this kind of variable a boolean,[21] and it can be assigned true or false, or you can give it math expressions using any of these operators, all of which return either ...
Read now
Unlock full access