O'Reilly logo

Learn to Program with Minecraft Plugins, 2nd Edition by Andy Hunt

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

Plugin: BackCmd with Save

Using the same ideas as with LocationSnapshot, you’re going to add data storage to the BackCmd plugin so that you can save the locations across server restarts. I’ll provide the outline and function signatures, but you will be writing the bodies of the functions, the actual code to make it work. Buckle up!

Now, the BackCmd plugin is a little more complicated than our simple LocationSnapshot. As you may remember from the plugin here, the BackCmd plugin tracks more than just a location per player; it tracks a Stack of Location objects for each player.

Bear in mind that the Database system can’t actually store Location objects. It can store a list, which we can use as a stack, but it can only store a list of a single ...

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