O'Reilly logo

Minecraft Mods Programming Absolute Beginner’s Guide by Rogers Cadenhead

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

23. Chop Down a Forest of Trees

In This Chapter

Examine the blocks in a large area of the game world

Find the block at an (x,y,z) location

Discover trees by checking for blocks that hold logs

Store locations that have been searched in an array list

Avoid server lag by using less memory in a mod

Create an inner class to represent an (x,y,z) location

Use the programming technique of recursion

Minecraft mods that add a new command to the game all start with the same basic framework. You extend the JavaPlugin class from the org.bukkit.plugin.java package; store the player, world, and server in instance variables; and override the superclass method onCommand().

When the player enters a command, onCommand() is called. If the command ...

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