O'Reilly logo

A Beginner’s Guide to Writing Minecraft Plugins in JavaScript by Walter Higgins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. A Guessing Game

One of the great things about computers is that they can make decisions and take different paths through a program based on those decisions. If computer programs did the same thing every time, then they would be pretty boring. Can you imagine playing a computer game that always did the same thing? Computers make decisions all the time. When you’re playing Minecraft, the server is constantly checking to see whether any players have died or whether their health or hunger levels are low. It’s checking to see whether a creeper is about to explode or whether a villager will accept a trade offer. All of these decisions are made using the humbly named if statement. The if statement is such a useful statement that it’s available ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required