This is actually not too difficult to implement by using scoreboard magic.
First, set up some scoreboard commands
scoreboard objectives add airborne dummy
scoreboard objectives add fallen dummy
Next, run the following commands on a fast clock (I suggest using a fill clock), in this order.
scoreboard players set @a airborne 0
execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:air -1 scoreboard players set @p airborne 1
scoreboard players set @a[score_airborne=0] fallen 0
scoreboard players add @a[score_airborne_min=1] fallen 1
The first two will set airborne
to 1 for every player who is not standing on something, i.e. the block beneath him is air
. The third command will reset the fallen
score to 0 for everyone who is not airborne
, the fourth increments the score 20 times a second instead. This means that fallen
is 0 as long as you were standing on something since your last fall.
Now you can select the falling players for teleportation using @a[score_fallen_min=XYZ]
. Replace XYZ
with however many seconds a player has to be above air to be considered "falling", multiplied by 20.
There is an issue with this however: Standing on the edge of a block will make you be considered falling, and I can't think of an elegant solution to this, short of chaining execute detect
commands to check a 3×3 area below the player for blocks.
Use pairs of one Repeat and one Chain Command block, one pair for each type of block (or for smaller numbers use good ol' Redstone clocks).
The repeat command block will test if there is a specific block one block under the Player:
/execute @e ~ ~ ~ testforblock ~ ~-1 ~ minecraft:YOUR-BLOCK-ID
And the chain one will add one to your scoreboard:
/scoreboard players add @a YOUR-BLOCK-ID 1
Note:
First you want to create the objective(s) and make them visible:
/scoreboard objectives add YOUR-BLOCK-ID dummy
/scoreboard objectives setdisplay sidebar YOUR-BLOCK-ID
And you want to create one objective for each block you step on frequently: grass, dirt, stone, cobble, wood logs, stairs, slabs and planks, netherrack, farmland, gravel, sand, air, water, …
Example:
First, create the objective:
/scoreboard objectives add dirt dummy
And make it visible:
/scoreboard objectives setdisplay sidebar dirt
Then, in a repeat command block, put this command:
/execute @a ~ ~ ~ testforblock ~ ~-1 ~ minecraft:dirt
And if it returnes true, execute this command:
/scoreboard players add @a dirt 1
Now, for each tick you step ( = are above) on one of the blocks you chose to put into your system, it's score on the left of your screen goes up. The blocks with the highest scores go up in the sidebar list.
You can also use good old comparators and redstone clocks to avoid numbers like Dirt: 8294, Grass: 34890
Best Answer
Ok, use the
/tp
command to tp the Player:for teleporting half block in
+z
.for -z, and so on - the first squigly line is the x coordinate, 2nd is the y coordinate and 3rd one stands for z.
For teleporting a Player into
+x
and+z
(or any other coordinates) at once a total of 0.5 Blocks, use this (via the Pythagorean stuff):For teleporting into
+x
,+y
, and+z
at once, use the following:Each such command will move the Player exactly by 0.5 Blocks - for teleporting the Player by 0.5 Blocks in more directions, simply combine two commands:
/tp @a ~-0.5 ~ ~
+/tp @a ~ ~+0.5 ~
=/tp @a ~-0.5 ~+0.5 ~
For also rotating the Player, use additional syntax:
/tp @a X Y Z <Y-Rotation> <X-Rotation>
For how to use this syntax, check out the y-rot and x-rot part of the tp command on Minecraft wiki.
If you don't want to target all Players, use
@p
or different target selectorsFor further reference, check out the Wiki article about commands (selectors, tp command), Digminecraft.com article or find other pages on Google.