Improved Teleport, for pre-1.8 Minecraft
WebMaka Oct 1st, 2015 (edited) 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- // $Id$
- Improved Teleport, for pre-1.8 Minecraft
- * Adds rotation and head tilt (pitch and yaw) control.
- Created by ActiumPraetor of WreckedGamers.com
- Requires: Any reasonable recent version of WorldEdit
- /cs teleport.js X Y Z R W
- * All parameters are floating-point, 8-decimal-place precision supported.
- X,Y,Z = Coordinates in space in X, Y, Z axes, as per the regular /tp command
- R = Rotation angle, in 180.0000 to -180.0000 degrees, where:
- -180.0000 = due north
- -90.0000 = due east
- 0.0000 = due south
- 90.0000 = due west
- 180.0000 = due north
- * If you exceed the range it loops around. No idea if this can break things though.
- W = Yaw angle, 255.0000 to -255.000 range, where:
- 255.0000 = straight up
- 0.0000 = level with the horizon
- -255.0000 = straight down
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- //Import the WorldEdit API package.
- // Start a WE edit session.
- var session = context.remember();
- // Grab the arguments. If not enough are provided, do some explaining to that effect.
- context.checkArgs(5,5,"<x> <y> <z> <rotation in degrees: -180 to +180, -90=E 0=S 90=W 180=N> <yaw: -255 to 255, 0=level, -=down, +=up>");
- // Fetch said arguments.
- var new_x = parseFloat(argv);
- var new_y = parseFloat(argv);
- var new_z = parseFloat(argv);
- var new_r = parseFloat(argv);
- var new_w = parseFloat(argv);
- // Move the player.
- var new_coords = Vector(new_x, new_y, new_z);
- player.setPosition(new_coords, new_r, new_w);
- // End!
RAW Paste Data