Electromagnet
alaindustrial:electromagnet
Summary
The Electromagnet is an EU/FE-rechargeable convenience item: it sits in any inventory slot (hotbar / main / off-hand) and automatically draws loose dropped items toward the player — ore drops in a mine, scattered pieces after an explosion, unclaimed drops. This is tier 1: a spherical radius of 5 blocks (up, down and sideways); each item actually pulled costs 2 EU/FE . An idle scan, with nothing in range, is free.
Pickup stays vanilla: every tick the magnet sets each item's velocity straight at the player (a seek, so items fly in from any direction — a drop below rises to you), and the player collects the item once it arrives. When flat the magnet simply goes quiet (like a drained Electric Drill mining at hand speed) until recharged. It charges wherever the mod's whole powered family does — the Battery Box charge slot and a worn Energy Pack.
Toggle (shift-right-click): the magnet can be switched off so you can carry it in your inventory next to farms, sorters and pipes without hoovering their items. A freshly crafted magnet is on.
Screen and modules (right-click): a plain right-click with the magnet in hand opens its screen — the charge, an on/off button and one module slot. The slot takes a filter module: it decides what the magnet pulls and what it leaves. A magnet with no module pulls everything, as before.
Energy
Its own EU/FE buffer, off the grid. Charged in the Battery Box slot and by a worn pack; spends charge per pulled item.
| Field | Value |
|---|---|
| Role | convenience item with an EU/FE buffer: a consumer at a charger |
| Buffer | 5,000 EU/FE |
| Charging | Battery Box slot / worn pack, ≤ 32 EU/FE/tick (capped by the LV ceiling) |
| Draw | 2 EU/FE per item pulled each scan tick; an idle scan is free |
| Passive drain | none (only for actual pulling) |
| Component | (Long, persistent + networkSynchronized) — the shared component of every powered item in the mod |
The draw is taken server-side only (in 26.2 is called only on a ServerLevel). A creative/spectating owner pays nothing (the rule shared by every EU/FE item) — the magnet still pulls.
Inventory
The magnet has no item storage of its own (stacks to 1), but it does have module slots: one on this magnet, three on the advanced one. The modules live on the magnet itself in the component (shared by every future module carrier; absent = nothing fitted). Besides that the magnet holds its EU/FE charge and the on/off flag (absent = on).
The magnet's screen opens with a plain right-click with the magnet in hand. On its own screen the magnet is locked in place: it cannot be picked up, thrown, swapped with a number key or with the off-hand key — otherwise its modules would be left without a carrier or duplicated. If the magnet is destroyed as a dropped item (lava, a cactus, the void), its modules drop next to it.
Block properties
Not applicable (item).
Recipes
Crafted on a workbench in the shape of a horseshoe magnet: an iron horseshoe body, a copper coil core at the centre (the electromagnet's winding), and an electronic circuit below (control). The top corners are the poles: redstone (power) on the left, lapis lazuli (magnetic "charge") on the right.
R L
ICI
IEI
- Recipe — shaped 3×3,
category: equipment:- top row: redstone (
minecraft:redstone), empty, lapis lazuli (minecraft:lapis_lazuli); - middle row: iron (
minecraft:iron_ingot) — copper coil — iron; - bottom row: iron — electronic circuit — iron.
- top row: redstone (
- Repair — not applicable: the magnet has no durability; "repair" is charging EU/FE (see Energy).
Behaviour
- Pulling (seek): every tick (= 1) the magnet gathers
ItemEntityin a spherical radius and sets each item's velocity straight at the player's body centre at blocks/tick. Setting (not adding) the velocity overrides gravity and friction, so a drop below the player rises to it and one above sinks — the pickup itself is vanilla once the item arrives. - Tariff: each item pulled costs 2 EU/FE per tick while it flies in. If the buffer can't afford it the magnet stalls; at 0 EU/FE it doesn't pull at all. At most 64 items are handled per pass (a guard against mass-drop lag).
- What it will NOT pull: items on their pickup delay (
hasPickUpDelay) — both a fresh playerQ-drop (so it doesn't instantly suck back what was just thrown) and "never pick up" items (delay 32767); items sitting in lava (so they aren't dragged through the fire); items out of range. Item frames / displays are untouched (the filter is strictly theItemEntityclass). - Seek speed is capped at
SEEK_SPEED(0.55 blocks/tick): fast enough for items to visibly fly in, but under the vanilla pickup window so they don't tunnel through the player. - Works from any slot: the magnet ticks in the hotbar, main inventory and off-hand (in 26.2 the off-hand ticks through the equipment path) — carry it anywhere, not only in hand.
- Toggle (shift-right-click): a shift-right-click flips on/off. State lives in the
magnet_enabledcomponent (absent = on; disabling writesfalse, re-enabling removes the component, so an on magnet is byte-identical to a fresh one). Toggling plays a metallic click (copper_bulbon/off — an electrical sound, not a cloth one) and posts an action-bar line. A disabled magnet pulls nothing and spends no EU/FE. - Filter (module): with a filter module fitted, the magnet pulls only items that pass the filter; a rejected item does not move and costs no EU/FE. The filter does not touch experience.
- Stuck item: if an item has not got closer to the player over 20 pulls (1 s) — behind a wall, in a pit, caught on an edge — the magnet lets go of it for 2 seconds and spends no EU/FE on it, then tries again. A full inventory is not this case: the magnet pulls and pays, the items fly after the player, and an item that has reached the player is no longer pulled or paid for.
- Readout: the bar under the icon shows charge (yellow, LV colour). The tooltip shows short lines: a flavour line, status (green "Active" / grey "Disabled"), the charge
X / Y EU/FE, and a radius/tariff line. - Drop/death/relog: charge and the on/off flag are stored on the item and survive.
- In creative: no charge is spent (the shared powered-family rule,, but pulling works.
Progression
- An LV-tier convenience item: it solves the classic tech-mod pain "walking a mine — loot comes to me".
- Available after the Battery Box and copper coil / circuit: without LV infrastructure the magnet can be neither crafted nor charged.
- The filter is a module in the magnet's slot. Suppressor zones and radius tier scaling (LV/MV/HV) are future work.
Related
- Electric Drill — the EU/FE-consumable precedent; a typical mine companion.
- Energy Pack — charges the magnet in the inventory on the move.
- Battery Box — charging the magnet (charge slot).
- Copper Coil, Electronic Circuit — crafting components.
Crafting
Shaped Crafting
▶
Electromagnet
Used in
Shaped Crafting
▶
Advanced Electromagnet
Shaped Crafting
▶
Vacuum Collector