Plugin: HelloWorld

It’s a long-held tradition in the programming world to start off with a simple test program that prints out the message “Hello, World.” So we’ll start off by building and running an existing plugin that does that in Minecraft—except we’ll send out a slightly more interesting message.

Here is the Java source code for our HelloWorld plugin, which is already typed in for you in the file ~/Desktop/code/HelloWorld/src/helloworld/HelloWorld.java. There’s a lot of weird stuff in here. (If you haven’t downloaded the code for this book to your Desktop yet, grab it now from http://media.pragprog.com/titles/ahmine2/code/ahmine2-code.zip. You can use unzip from the command line to unpack the archive and create all the files.)

HelloWorld/src/helloworld/HelloWorld.java ...

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.