im trying to create a trident that when thrown will make salmon tp to it. the example command is tp @e[type=husk] @e[type=snowball] this was the test but it didnt work with (@e[type=snowball]) being red. Am i doing something wrong or is it possible at all.


Look at the error message caused by @e[type=snowball].

Only one entity is allowed, but the provided selector allows more than one at position 0:

What you need to do is limit the number of entities returned to 1. So try the following instead:


Learn more about these concepts on the Minecraft Wiki:

  • Thanks alot this really helps – Savory Gravory Jul 18 '20 at 23:05

What should that command do if there is more than one snowball on the map? It doesn't make sense to teleport one entity to more than one, and Minecraft can't tell which snowball you mean, so it throws an error.

Do you want to ...

Teleport each husk to the snowball nearest to the command block?

/tp @e[type=husk] @e[type=snowball,sort=nearest,limit=1]

Teleport each husk to the nearest snowball to the husk?

/execute as @e[type=husk] at @s run tp @s @e[type=snowball,sort=nearest,limit=1]

Pick a random snowball and teleport all husks to it?

/tp @e[type=husk] @e[type=snowball,sort=nearest,limit=1]

Assume there is only ever one snowball, and cause unknown behavior if there turns out to be more than one?

/tp @e[type=husk] @e[type=snowball,limit=1]

Something else I haven't thought of?

You have to include limit=1 somewhere in the command to tell Minecraft to only pick one entity to try to teleport things to. At that point, it's a good idea to decide what should happen if there is more than one snowball (or trident in the non-hypothetical case) and modify the command accordingly.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.