Electromagnet

Electromagnet

alaindustrial:electromagnet
ItemsLVImplementeditemenergymagnetpickupconvenience

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.

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.

FieldValue
Roleconvenience item with an EU/FE buffer: a consumer at a charger
Buffer5,000 EU/FE
ChargingBattery Box slot / worn pack, ≤ 32 EU/FE/tick (capped by the LV ceiling)
Draw2 EU/FE per item pulled each scan tick; an idle scan is free
Passive drainnone (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

Not applicable — the magnet has no internal item storage (stacks to 1). It holds only EU/FE charge and the on/off flag (absent = on).

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.

Repair — not applicable: the magnet has no durability; "repair" is charging EU/FE (see Energy).

Behaviour

Pulling (seek): every tick (= 1) the magnet gathers ItemEntity in 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 player Q-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 the ItemEntity class). 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_enabled component (absent = on; disabling writes false, re-enabling removes the component, so an on magnet is byte-identical to a fresh one). Toggling plays a metallic click (copper_bulb on/off — an electrical sound, not a cloth one) and posts an action-bar line. A disabled magnet pulls nothing and spends no EU/FE. 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. Filters (tag whitelist/blacklist), suppressor zones and radius tier scaling (LV/MV/HV) are future work.

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
Any Redstone Dust
Any Lapis Lazuli
Any Iron Ingot
Copper Coil
Any Iron Ingot
Any Iron Ingot
Electronic Circuit
Any Iron Ingot
Crafting Table
Electromagnet
Electromagnet

Used in

Shaped Crafting
Reinforced Electrum Plate
Copper Coil
Reinforced Electrum Plate
Advanced Circuit
Electromagnet
Advanced Circuit
Reinforced Electrum Plate
Energy Crystal
Reinforced Electrum Plate
Crafting Table
Advanced Electromagnet
Advanced Electromagnet