Hi, im wondering how i can save locations like homes and when you right click a block you get teleported there.
There are multiple ways to save, depending on your needs. Are these locations going to be global, or player based? Do they need to persist over restarts?
You can store the location to a hashmap when the command is used. just use a string as the key. Then use if events on the block, so if it's a certain block, and if it's a right-click, then teleport the player to hashmap.get("keyname"). The thing is, if you want the list of locations to persist after a reload/restart, you'll need to either convert the location to a string, or use a custom method to make it serialized (so that it can be written to file).
Like I said, if you want it to persist on restart you'll need to save it, and locations aren't serializable. You'll either need to convert the .getX, getY, .getZ into an string and parse it or use a custom serializableLocation method.