Chapter 4Plugins Have Variables, Functions, and Keywords

In this chapter we’ll take care of a lot of the basics of writing Java code. With these tools in your toolbox, you’ll know the following:

  • What the funny characters mean in Java

  • How to use variables to hold number and character string values

  • How to declare and use functions: lists of Java instructions

  • How to control code with if, for, and while statements

As you may have noticed, there’s a lot of text in the plugin source code that I haven’t explained yet. Let’s dig deeper into Java and take a look at what all that text means—it’s the raw material of programming plugins.

As you saw in Chapter 3, Build and Install a Plugin , a program in Java is just a text file. Look at the ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.