mojira.dev
MC-124137

Varieties of /teleport create ambiguities for tab-completion and syntax highlighting

The different syntaxes of /teleport introduce ambiguities for tab completion and syntax highlighting.

  1. Is the first argument destination or targets? "/tp @p <tab>" doesn't give tab completions for the <destination> argument. "/tp @a" doesn't complain that the <destination> argument may only return one entity.

  2. Is the first argument a player name or part of a set of coordinates? Attempting to teleport the player 1234321 to 0 0 0: type "/teleport 1234321" and start typing in the coordinates, after the y-coordinate, "1234321 0 0" will be highlighted as one argument even though it isn't.

  3. Is the second argument a player name or part of a set of coordinates? When I want to teleport myself to 0 0 0, I type "/teleport @p". After the x coordinate, it highlights the 0 in "/teleport @p 0" as a valid argument.

This could be fixed by introducing keywords or even subcommands like it was done to avoid ambiguities in /execute, or like it was done in /data.

Linked issues

Comments 28

Affects 18w20c

I'm not sure if this relates to this problem, but I've noticed in the logs that the game seems to issue these warnings every time:

[09:25:39] [Client thread/ERROR]: Realms module missing
[09:25:43] [Client thread/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[09:25:43] [Client thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[09:25:43] [Client thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[09:25:43] [Client thread/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[09:25:43] [Client thread/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[09:25:43] [Client thread/INFO]: Loaded 0 recipes

 

This example is from the 1.13-pre2 version but I've noticed it in previous snapshots as well.

Pegasus Epsilon

1.13-pre5, on server startup:

 

[23:56:57] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:56:57] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:56:57] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:56:57] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:56:57] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]

Still present in 1.13 full release. Is there anything for the server operator to do to resolve it?

Still present in 18w31a. Very confusing to see these at startup. 

18 more comments

Also in 1.17.1... This gets really annoying on the server logs for sure, I keep on thinking the server is crashing on boot. As well as this, the weird entity tag starting dd12be always makes me think that there is some entity corruption or something... This really needs fixing for sure

The simplest fix I can think of: make the target entity a mandatory argument (so no /tp <pos> and no /tp <destination>) then /tp <entity> 0 will have 0 as destination, and /tp <entity> 0 0 will complain about a missing coordinate.
I recon people use the shortcut frequently, and will complain about it being lost; but people also use the /gamemode shortcuts/numbers and they were removed too (and they didn't even cause issues like the autocompletion). It'll just take those people a bit of getting used to, and there's no issues anymore.

Affects 1.18

Affects 1.18.1

Can confirm in 1.18.2.

[Mod] redstonehelper

(Unassigned)

Confirmed

Platform

Low

Commands

/teleport

Minecraft 18w02a, Minecraft 18w06a, Minecraft 18w20c, Minecraft 1.13-pre1, Minecraft 1.13, ..., 1.17.1, 1.18, 1.18.1, 1.18.2, 23w05a

Retrieved