[HELP?] How to attract items to player

Started by MattiDragon835 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[HELP?] How to attract items to player
Sun, 10/20/2019 - 10:42 (edited)

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?

 

Edited by MattiDragon835 on Sun, 10/20/2019 - 10:42
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can have it so all items…
Sun, 09/06/2020 - 20:44

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).