Minecraft – how do i tp entitys

minecraft-commandsminecraft-java-edition

how do I teleport entitys like cobblestone on the ground to a certain location do i just use teleport @e x y z or do i use teleport @e[something here] x y z does anybody know? by the way i am playing in 1.10 i know how to teleport creepers and such but not entitys like cobblestone i tried to do /tp @e x y z and /tp @e[type=cobblestone] x y z but none of them worked I need it because they have to mine a reappearing block and the entitys fly every where I want them all to center at a x y z co-ordnets

Best Answer

If you want to teleport any dropped item, then you simply need to select them with @e[type=Item]. For example:

/tp @e[type=Item] X Y Z

If you want to teleport dropped items of a certain type (e.g: only cobblestone), then it'll take two commands.

There's no selector argument (like type=) that can directly detect the item name of a dropped item entity, so you'll need to first use a command that can target based on NBT data, such as /scoreboard players tag:

/scoreboard players tag @e[type=Item] add IsCobblestone {Item:{id:"minecraft:cobblestone"}}

You can then target the item entities based on that scoreboard tag you just added to it:

/tp @e[type=Item,tag=IsCobblestone] X Y Z