TeleportBack:
type: world
events:
on player jumps:
- if <player.location.x.replace[-].sub[<context.location.x.replace[-]>].is[LESS].than[0.2]> || <player.location.z.replace[-].sub[<context.location.z.replace[-]>].is[LESS].than[0.2]> {
- queue clear
}
- if <player.location.direction.contains[north]> {
- define z 1
} else if <player.location.direction.contains[south]> {
- define z -1
} else {
- define z 0
}
- if <player.location.direction.contains[west]> {
- define x 1
} else if <player.location.direction.contains[east]> {
- define x -1
} else {
- define x 0
}
- teleport <player> <player.location.add[<def[x]>,-0.5,<def[z]>]>