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 ...

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.