Skip to content

Thisway Teleporting Mechanics

toydotgame edited this page Mar 17, 2021 · 6 revisions

Thisway Teleportation Code Overview

Thisway has a simple but very precise set of operations to teleport the player:

  • The player's X, Y, Z, camera yaw and pitch, along with their current world/deimension.
    • X, Z, yaw, and pitch are all exact values (to ~10 decimal places). The Y is rounded to ~.0 so that the player is standing on the block.
  • The X and Z coordinates are modified by the player-specified amount relative to the cardinal direction they're facing.
  • The player's head location is calculated against a list of safe blocks. If it is a match, Thisway will continue; if not, everything stops and an error is sent to the sender.
  • If the block the player will be standing on is air, a glass block will be placed to catch them.
  • The player's actual new location is calculated and then they are teleported.

Throughought this process, data is collection on the player's location data. If Debug Mode is enabled, it's printed to chat. See more on Debug Mode's output here.

Tracking of Player's Head Into a Block

As of update 1.1 (73bed9a), Thisway has a detector to see if the new location [that it will teleport you to] is safe for you to be teleported to (The block where your head will be!). Thisway has a select list of blocks which it will allow the player's head to be in.

Table of Thisway "Safe" Blocks

Name ID Spigot Namespaced ID
Air 0 AIR
Mushroom 39, 40 BROWN_MUSHROOM, RED_MUSHROOM
Carpet 171 CARPET
Cocoa Pod 127 COCOA
Wheat Crops, Carrots, Potatoes 59, 141, 142 CROPS
Dead Bush (Possibly also the Bush (It's rare so Spigot might not. Open an issue if you can't teleport into a Bush)) 32, (31) DEAD_BUSH
Detector Rail 28 DETECTOR_RAIL
Repeater (In block state) 93, 94 DIODE_BLOCK_OFF, DIODE_BLOCK_ON
Flower Pot 140 FLOWER_POT
Ladder 65 LADDER
Lava (Flowing and still) 10, 11 LAVA, STATIONARY_LAVA
[Oak, Spruce, Jungle, and Birch] Leaves 18 LEAVES
Lever 69 LEVER
Melon Stem 105 MELON_STEM
Painting 321 PAINTING
[Nether & End] 90, 119 PORTAL
Powered Rail 27 POWERED RAIL
Pumpkin Stem 104 PUMPKIN STEM
Rail 66 RAILS
Rose 38 RED_ROSE
Comparator (In block state) 149, 150 REDSTONE_COMPARATOR_OFF, REDSTONE_COMPARATOR_ON
Redstone Torch 75, 76 REDSTONE_TORCH_OFF, REDSTONE_TORCH_ON
Restone Dust (In block state) 55 REDSTONE_WIRE
[Oak, Spruse, Jungle, and Birch] Sapling 6 SAPLING
Sign 63, 68 SIGN_POST, WALL_SIGN
Mob Head 144 SKULL
Snow Layer 78 SNOW
Water (Flowing and still) 8, 9 WATER, STATIONARY_WATER
Pressure Plate 70, 72 STONE_PLATE, WOOD_PLATE
Lilypad 111 WATER_LILY
Cobweb 30 WEB
Door(s) (Block state) 64, 71 WOODEN_DOOR, IRON_DOOR
Dandelion 37 YELLOW_FLOWER
Trapdoor 96 TRAP_DOOR
Short Grass 31 LONG_GRASS

Please open a new issue if you try to teleport into one of these blocks, and it fails.

Thisway Wiki


Here is where you can find out how Thisway works and how to use Thisway.

Pages:

Clone this wiki locally