Does anyone know how to make a magnet?

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

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

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.

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!!!

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

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?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"here is a example of a…
Sun, 12/15/2024 - 00:32

"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"

this works, even in newer versions, i am using a newer version of mcreator and your other methods are for 

older versions, so i use Entropy's method