Chapter 5. Your First Minecraft Plugin

In this chapter you’ll dive in and create your first Minecraft plugin. A plugin is a small program that is loaded and executed by a larger program. The larger program you’ll be using is, of course, your Minecraft server. This first plugin will be short—just a couple of lines of code—so you won’t have to type too much, but you should read through this first chapter and try to understand the code and the notes. You’ll build on the knowledge learned here when creating more sophisticated plugins in later chapters.

Hello World

Launch your editor and open the helloWorld.js file you created in Chapter 4. Once opened, you can remove the comment entered previously and type the following text:

console.log('Hello ...

Get A Beginner’s Guide to Writing Minecraft Plugins in JavaScript 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.