Magnet
PluginGPL-3.0-only

Magnet

A plugin for the Magnet structure (schematic for the Litematica mod, available in the GitHub repository) and the Magnet item.

25
Downloads
0
Followers
3 weeks ago
Updated
📦
3
Versions

📖About Magnet

Magnet

Magnet is a Paper plugin for Minecraft that adds portable magnets and stationary magnetic cores.

Portable magnets attract nearby dropped metal items while held by a player. Stationary magnetic cores are 2x2x2 block structures that pull dropped metal items toward their center.

Features

  • Portable magnet item issued with /magnet give
  • Portable magnets work from the main hand and off hand
  • Stationary 2x2x2 magnetic cores
  • Configurable core radius and strength
  • Core material profiles configurable in config.yml
  • Magnetic frame scanning around cores
  • Damaged cores disable attraction until repaired or rescanned
  • Core diagnostics with /magnet core info <id>
  • Saved cores in cores.yml
  • English and Russian messages
  • Example structure in schematic/Magnet.litematic

Requirements

  • Minecraft / Paper: 1.21.11
  • Java: 21

Commands

Command Description
/magnet Shows help
/magnet give Gives the player a portable magnet
/magnet core create <id> [radius] [strength] Creates a core from a 2x2x2 structure
/magnet core createat <id> <x> <y> <z> [radius] [strength] Creates a core at coordinates
/magnet core remove <id> Removes a saved core
/magnet core list Lists saved cores
/magnet core info <id> Shows core diagnostics
/magnet core rescan <id> Rescans the core frame
/magnet core refresh <id> Recalculates the core after replacing blocks
/magnet core set <id> <radius;strength> <value> Changes one core's radius or strength
/magnet core reload Reloads cores and settings
/magnet profile list Lists material profiles
/magnet profile info <material> Shows one material profile
/magnet profile set <material> <radius;strength;priority> <value> Updates a material profile
/magnet profile reload Reloads material profiles

Portable Magnet

The portable magnet is an amethyst shard marked with PersistentDataContainer, so the plugin can distinguish it from a regular item.

Every 2 ticks, the plugin checks online players. If a player is holding a portable magnet, supported dropped items within 7 blocks are pulled toward the player.

Strongly attracted items include iron items, chainmail armor, anvils, rails, minecarts, buckets, shears, compasses, and similar metal items.

Netherite items are attracted with reduced force.

Magnetic Cores

A stationary magnetic core is created from a complete 2x2x2 cube of configured core materials.

Look at one of the eight core blocks and run:

/magnet core create <id>