tModLoader ItemMagnetPlus - Customizable Item Magnet

direwolf420

Terrarian
ItemMagnetPlus

banner.png

Download via Mod Browser ingame! Available on both 1.3 and 1.4 tModLoader!
Steam Workshop page: Workshop


(For older 1.3 versions of this mod, download them here)

ItemMagnetPlus adds a single item called "Item Magnet" that does the obvious thing: Sucking in items around you so you don't have to run around and collect them yourself. It is available on the Mod Browser.

Adds:
Item Magnet (and corresponding buff) that
* can be crafted with simple materials (Iron/Lead)
* works while in your inventory
* can be toggled on and off
* has adjustable range and item succ speed
* has increased stats after killing bosses
* customizable via config ingame to fit your playstyle

How to use:
* Left click cycles through its ranges
* Right click shows current range (you can always check the stats on the buff tooltip)
* This right click functionality changes to "turn off" when "Buff" in the config is false
* Killing bosses improves its stats
* If you want it to either be on or off, change "Scale" in the config to anything but "Increase With Bosses"

Multiplayer:
* This mod is multiplayer compatible, the config is entirely server side, but the buff flag is forced to 1
* Items that are inbetween two players with magnets will "float"
* If "Instant" is enabled and multiple players are in range of an item, it will always go to the same player (it is based on join order)
* Due to the way the "grab delay" is only set in singleplayer, items dropped by the player will instantly latch onto the player, which is normal behavior
* Items might not get sucked up and turn into a "ghost" with the Auto Trash Mod enabled
* Lost items due to this bug won't be recovered
* Report any bugs in the forum thread (please)

Progression: (default config)
Starts with:
Range = 10 (blocks in each direction)
Velocity = 8
Acceleration = 8

Ends with: (killing Moonlord)
Range = 120 (one and a half screens)
Velocity = 32
Acceleration = 32

About the config:
* Buff decides if it gives you a corresponding buff icon to show the status of the magnet
* Held decides if the magnet works only when held
* "Activate On Enter" decides if magnet should be automatically activated when entering the world
* Filter function: Presets (hearts, mana stars, coins, pickup effects), blacklist/whitelist. Presets override black/whitelist
* Magnet stats are limited to sensible values (Range only goes up to about three screens in any direction)
* If you increase velocity or acceleration too much from those recommended above, items might get "stuck" on you until you deactivate it again
* Beware of lag when increasing these values, especially range
* If the difference between velocity and acceleration is too big, items will go in circles around you or get stuck until you deactivate it
* "Instanct" skips any velocity or acceleration checks and directly teleports the item to your location
* After you change the values in the config, use the magnet again to take effect

Showcase


Localization:
If you want to add support for different languages, you are welcome to contribute localizations here: Github
List of localization contributors:
* Polish: Taco
* Russian: GodBybrid

Source Code
Github

Credits

- Panini and her server for playtesting (check out her amazing TerrariaChatRelay mod!)
- Joeyrsp for bouncing off ideas and giving me the rights to use his mod name
- Cinnamonstrosity for suggestions and playtesting
- Harblesnargits for the sprites
- goldenapple for the config guide (the old config pre-ModConfig)
 
Last edited:
Interesting mod. The sprite could use some shading, and is it 2x2 pixels?(terraria sprites are) But yeah, is cool.
 
So as much as I absolutely adore the idea of this mod (been looking for one for a while, the best I've found is magnets you have to be actively holding for them to work) I can't use it since I'm getting a game breaking bug.

The moment I left click with the magnet in my hand to increase the range, my controls lock up, and nothing works. Alt+f4 gets me out, and I reload, and I still can't move or do anything. So I disabled the mod, and bam, I can move again, everything's back to normal. I re-enable it to see if it was a one time thing, and the exact same thing happens again.

I'm using the default config, and a lot of mods, so there may be a conflict somewhere if this isn't re-producable by anyone else.

Also, while I'm here, I'd like to ask 2 questions: First, does the scaling work based just on unique bosses killed, therefore mod bosses would work and it would increase more than vanilla, or is it purely vanilla bosses killed? Second, what would the proper config look like if I wanted it to start off at 10 like it does, but scale to like 500, or is that not possible?
 
So as much as I absolutely adore the idea of this mod (been looking for one for a while, the best I've found is magnets you have to be actively holding for them to work) I can't use it since I'm getting a game breaking bug.

The moment I left click with the magnet in my hand to increase the range, my controls lock up, and nothing works. Alt+f4 gets me out, and I reload, and I still can't move or do anything. So I disabled the mod, and bam, I can move again, everything's back to normal. I re-enable it to see if it was a one time thing, and the exact same thing happens again.

I'm using the default config, and a lot of mods, so there may be a conflict somewhere if this isn't re-producable by anyone else.

Also, while I'm here, I'd like to ask 2 questions: First, does the scaling work based just on unique bosses killed, therefore mod bosses would work and it would increase more than vanilla, or is it purely vanilla bosses killed? Second, what would the proper config look like if I wanted it to start off at 10 like it does, but scale to like 500, or is that not possible?
I had no issues regarding the game locking up, this sounds odd. Are you sure you have a buff slot available? Do you see the buff apply before you freeze? Is the game fine if you just keep it in your inventory? Does the game freeze or can you just not move? I have only tried this in a 26-mod big mod pack and it worked fine for me.
Could you try only this mod and no others and test it?
For the first question, it only works for vanilla bosses right now
For the second question, you can set the scale to 1 (makes it so you can toggle all the ranges) and set range to 500. If you kill any bosses though the number will rise (by 10 per boss (side bosses like queen bee or king slime only increase velocity and acceleration))
 
Last edited:
I had no issues regarding the game locking up, this sounds odd. Are you sure you have a buff slot available? Do you see the buff apply before you freeze? Is the game fine if you just keep it in your inventory? Does the game freeze or can you just not move? I have only tried this in a 26-mod big mod pack and it worked fine for me.
Could you try only this mod and no others and test it?
For the first question, it only works for vanilla bosses right now
For the second question, you can set the scale to 1 (makes it so you can toggle all the ranges) and set range to 500. If you kill any bosses though the number will rise (by 10 per boss (side bosses like queen bee or king slime only increase velocity and acceleration))

I figured out the conflict, disabled every mod except magnet, and enabled 5 at a time until it stopped working, then narrowed it down. As soon as I got to the mod that conflicts I knew it'd be that one before I even tested it, it just seemed so obvious once I considered it.

https://forums.terraria.org/index.php?threads/even-more-modifiers-relaunch-beta.68438/

It assigns extra modifiers to weapons and armor. My guess is it tries to assign modifiers to the magnet and it breaks.
 
I figured out the conflict, disabled every mod except magnet, and enabled 5 at a time until it stopped working, then narrowed it down. As soon as I got to the mod that conflicts I knew it'd be that one before I even tested it, it just seemed so obvious once I considered it.

https://forums.terraria.org/index.php?threads/even-more-modifiers-relaunch-beta.68438/

It assigns extra modifiers to weapons and armor. My guess is it tries to assign modifiers to the magnet and it breaks.

I have found the cause of this bug, and it is fixed and updated.
 
Last edited:
Created a better showcase video, enjoy:

Awesome. One thing that I think you should really showcase more (if you ever bother to do another one) is that you don't have to be holding the magnet for it to work (which is what 99.9% of other mods have you do, or they have a pet that magnetises for you) and that you don't even have to have it on your hotbar, just in your inventory.

That is honestly 80% of the reason that this mod is a MUST have for me (the other 20% is the customization).

Also if possible, I'd love to have a config option to turn off the buff while still keeping the magnet on, because I run a bunch of mods and I'm running into buff slot issues where in a hectic fight my magnet gets turned off sometimes if enough buffs proc to over-ride it.
 
Awesome. One thing that I think you should really showcase more (if you ever bother to do another one) is that you don't have to be holding the magnet for it to work (which is what 99.9% of other mods have you do, or they have a pet that magnetises for you) and that you don't even have to have it on your hotbar, just in your inventory.

That is honestly 80% of the reason that this mod is a MUST have for me (the other 20% is the customization).

Also if possible, I'd love to have a config option to turn off the buff while still keeping the magnet on, because I run a bunch of mods and I'm running into buff slot issues where in a hectic fight my magnet gets turned off sometimes if enough buffs proc to over-ride it.

This is implemented in the new update, enjoy! I had to turn the "right click to show range" functionality into "turn off" in the no-buff mode since you have no easy way to turn the magnet off otherwise.
 
This is implemented in the new update, enjoy! I had to turn the "right click to show range" functionality into "turn off" in the no-buff mode since you have no easy way to turn the magnet off otherwise.
Awesome. There's always cycling through all the ranges, but yeah I guess that could get tedious after you've upgraded the range a bunch of times. I use a custom range anyway and just set it to not scale and just scale it myself as I get further in the game, so the range show option actually stopped working for me anyway, it just shows the default (lowest) range. Not really an issue since I'm at the point where the range extends off the screen anyway, so if it showed off the screen it'd be less obvious to know when I turn it off or on (would have to read the text).

Big commends for the prompt updates and improvements. Excited to see where this mod goes in the future, although it's already essentially feature complete for what I need from it. That's mostly why I'm excited to see if you come up with anything cool that I can't even think of.

This is definitely a must have mod for me, and I'll definitely be recommending it to the few of my friends that still play.
 
Awesome. There's always cycling through all the ranges, but yeah I guess that could get tedious after you've upgraded the range a bunch of times. I use a custom range anyway and just set it to not scale and just scale it myself as I get further in the game, so the range show option actually stopped working for me anyway, it just shows the default (lowest) range. Not really an issue since I'm at the point where the range extends off the screen anyway, so if it showed off the screen it'd be less obvious to know when I turn it off or on (would have to read the text).

Big commends for the prompt updates and improvements. Excited to see where this mod goes in the future, although it's already essentially feature complete for what I need from it. That's mostly why I'm excited to see if you come up with anything cool that I can't even think of.

This is definitely a must have mod for me, and I'll definitely be recommending it to the few of my friends that still play.
Thats good to hear that you are using the configuration options, I'm wondering what the context is with the range only showing 10 even tho yours is much bigger.
 
Thats good to hear that you are using the configuration options, I'm wondering what the context is with the range only showing 10 even tho yours is much bigger.
No clue, I currently have my velocity and acceleration at 32, and scale at 0, range at 500.

As you can see here https://imgur.com/2ID7b0D the range display shows 12 when I turn it on, but the text says 500. This is still on the last version, since I'm still playing since you updated (version 3 in the config).
 
ah it is in a different color than green, I made it so when the range is outside of that rectangle (over 60) it loops back to 10 and keeps on going
so you still have a sense of increments (but since you use scale 0 it doesnt matter)
 
so i am having a glitch to where instead of the items coming to me they are being pushed away like i am the opposite of a succing magnet help?
 
so i am having a glitch to where instead of the items coming to me they are being pushed away like i am the opposite of a succing magnet help?
nevermind my acceleration was at 42 so everything was being pushed away all i had to do was lower my acceleration in the config
 
Back
Top Bottom