October 2014
Beginner to intermediate
285 pages
6h 24m
English
Let’s use some of these features in a complete plugin. Here’s the full source for BackCmd that provides a single command named back. Go ahead and build and install it:
| | $ cd Desktop |
| | $ cd code/BackCmd |
| | $ ./build.sh |
And restart the server.
Now teleport to a couple of locations, either by using the /tp command in creative mode or by right-clicking on an Ender Pearl in survival mode.
Now type /back, and you’ll be teleported back to your last location.
This plugin will listen for events to keep track of where you’ve been, and let you return to previous locations in order.
| BackCmd/src/backcmd/BackCmd.java | |
| | package backcmd; |
| | |
| | import java.util.ArrayList; |
| | import java.util.HashMap; |
| | import java.util.List; |
| | import ... |
Read now
Unlock full access