Does anyone know how to make a magnet?

Started by MattiDragon835 on Sat, 05/16/2020 - 11:55

Topic category: Help with modding (Java Edition)

Last seen on 11:40, 4. Oct 2020
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Does anyone know how to make a magnet?
Sat, 05/16/2020 - 11:55

As the tittle says i want to add a magnet to my mod. There are a lot of mods out there which do the same (or similar) thing so it should be possible.

There doesn't seem to be a way to interact with entities nearby so even if I learn how to move the properly it would still be impossible.

It's okay if it includes coding. I haven't coded in Java but i have used a few other languages.

Last seen on 16:15, 8. Dec 2020
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
here is a example of a…
Sun, 05/17/2020 - 10:51

here is a example of a magnet item you hold that moves items to you from 8 blocks around you

under when item in hand tick

Magnet

tp @e[type=minecraft:item,distance=..8] @s

you can change this to a tool's on block break for example

Last seen on 11:40, 4. Oct 2020
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yes it works but i would…
Sun, 05/17/2020 - 17:14

Yes it works but i would idealy like it to slowly move them to the player.

 

I think its possible with math but the problem is commands are the only way to target entities in a area.