Topic category: Help with Minecraft modding (Java Edition)
I am making a mod with a potion that attracts items(and, or mobs) to the player(or entity). I tried to use a minecraft command but it didn't work:
---------------------------------------------------------------OnPotionTick------------------------------------------------------------------------------------------------
Execute command/ [create text with] [create text with] [create text with] "tp @e[r"
[[[Number dependency:amplifier]+[1]]x[10]]
[create text with] "]"
[Number dependency:x]
[create text with] [create text with] " "
[Number dependency:y]
[create text with] " "
[Number dependency:z]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
So /tp @e[r=amplifier X 10] x y z
Does anybody know how to make this work?
You can have it so all items within a certain distance are teleported to the player. This will usually create an effect where it looks like it zooms up to you really fast, which looks really cool, though I'm not sure what causes it.
Execute command "tp @e[type=item,distance=..#] ~ ~ ~" in the name of target entity or something like that (so that it's running the command as the creature). Replace the "#" with the max number of blocks away (something around 4 is good).