Does anyone know how to make a magnet?

Started by MattiDragon835 on

Topic category: Help with modding (Java Edition)

Last seen on 14:24, 21. Feb 2022
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Does anyone know how to make a magnet?

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:
  • 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 14:24, 21. Feb 2022
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Last seen on 10:34, 14. Aug 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Sat, 07/09/2022 - 11:06

''''

Last seen on 10:34, 14. Aug 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is procedure you must…
Sat, 07/09/2022 - 11:13

This is procedure you must use in 2 triggers: ,,When item in an inventory,, and ,,When item in a hand,, for everything to work correctly!!!

Last seen on 21:29, 15. Feb 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This may help you. Attempt…
Sun, 10/30/2022 - 15:33

This may help you.

Attempt to override motion vector of {target]
To Vx: X position of [target] - x / 100 * -1
To Yx: Y velocity of [target]
To Zx: Z position of [target] - z / 100 * -1

Last seen on 08:07, 20. Apr 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do u have it track…
Wed, 02/07/2024 - 13:23

how do u have it track certain items?