I was thinking for this plugin, it would use the WorldGuard API as Para said to find the region, then have different certain warp points for different regions.
We could have one method for the process of the teleportation. However with the WorldGuard regions, we would either have to list out all the cave regions in an ArrayList, and have one "if" statement like
ArrayList <String> region <String> = new ArrayList (forgot Syntax, too lazy to get it back up)
ArrayList <String> teleportspot <String> = new ArrayList
[Still dont know WG Api]
if (player's location == get.region[x])(x could be any of the cave regions in the ArrayList){
// if statement with the command (didnt learn bukkit api) then teleportspot[x]
}
Still never learned Bukkit API yet, don't know if it could work. We could use Hashmaps with the Regions as Keys, and Coords of Teleportation Spots as the values. Still very scratchy and confusing, I should go learn Bukkit Api now.