mojira.dev
MC-124124

/teleport ... facing ... is not working correctly

The new /teleport ... facing is not working correctly
for example:

/teleport @s ~ ~ ~ facing 0 0 0


would not rotate the player at all

and use facing entity would have incorrect results too,for example

/teleport @p ~ ~ ~ facing entity @e[type=armor_stand,limit=1] feet

[media]


and

/teleport @p ~ ~ ~ facing entity @e[type=armor_stand,limit=1] eyes

[media]

both command produces unintended result

Linked issues

Comments

Nathan Adams

Please note that by default your anchor is your feet, so facing means making your feet face them. This is why your eyes are looking above what you wanted.

If you want the camera to be centered on their eyes, you need to prefix with

execute anchored eyes run
SYL_qiuyifeng

Oh thats my fault, didnt realise the default anchor is my feet
but i think the facing <location> part is still valid, because it do not rotate my facing no matter using eyes as anchor or not

violine1101

Apparently, the rotation arguments (i.e. /teleport @s ~ ~ ~ 0 90) don't work either anymore, might be related to that.

onnowhere

/teleport @s ~ ~ ~ 0 90 works, /teleport ~ ~ ~ 0 90 no longer works as it was changed to only accept coordinates due to some ambiguity of teleport tab complete so this was the compromise iirc

violine1101

I could have sworn that that exact command /teleport @s ~ ~ ~ 0 90 didn't work when I tested it. There wasn't an error message, it just didn't have any effect. Now it works, weird.

Sam Shakeshaft

Actually,

/teleport @s ~ ~ ~ facing 0 0 0

causes a fatal error in the console.

Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at i.a(SourceFile:147)
	at bob.b(SourceFile:782)
	at bob.a(SourceFile:382)
	at net.minecraft.client.main.Main.main(SourceFile:140)
Caused by: java.lang.NullPointerException
	at aaf.a(SourceFile:2571)
	at aap.a(SourceFile:2159)
	at byf.a(SourceFile:1248)
	at jy.a(SourceFile:71)
	at jy.a(SourceFile:13)
	at ic$1.run(SourceFile:13)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at i.a(SourceFile:146)
	... 3 more
ALH

I believe I have found why this is failing. The teleport command is ignoring 'facing' arguments if there is no change in position. 

/execute rotated as Default_Ex at @e[name=WandRay] run teleport @e[name=WandRay] ^ ^ ^ facing ^ ^ ^-1

Doesn't do anything when it should rotate the entity "WandRay" in the same direction as the player "Default_Ex" (@p gives the same result).

/execute rotated as Default_Ex at @e[name=WandRay] run teleport @e[name=WandRay] ^ ^ ^0.01 facing ^ ^ ^-1

This however works but will require another teleport afterward to undo the change in position

Addendum:

I noticed with arrows and tridents that it actually does try to rotate the entity but it just twitches slightly instead of performing the rotation.

SYL_qiuyifeng

Nathan Adams

Confirmed

Minecraft 18w02a

Minecraft 18w03a

Retrieved