Magnes
Carry a magnet, and dropped items and experience orbs within reach come to you instead of having to be walked over. It works from anywhere in the inventory or a Curios slot, and a right-click switches it off and on.
截图
介绍
Magnes adds a magnet. Carry one, and dropped items and experience orbs within reach come
to you instead of waiting to be walked over. It works from anywhere in the inventory —
the point of it is not having to hold it — and a right-click switches it off and on.
The magnet
Four iron ingots and a block of redstone, laid out as the thing it is:
I I
I I
R
It is drawn in colour while it is on and grey while it is off, and the click sounds
higher for on than for off, so the two are told apart without looking. The tooltip says
how far it reaches.
With Curios installed it can be worn in a charm slot as well, and a worn magnet counts as
held. Curios is optional.
Nothing happens without one. If every player being magnetic is what you want, set
needed = false under [magnet] and the item becomes decoration.
What it will not take
An item still inside its pickup delay is left alone. That delay is what makes dropping
something possible at all — without it, a magnet would take back everything you threw the
instant you threw it — and it is also what keeps another player’s fresh death drop out of
reach. A magnet that pulled a stranger’s inventory across the room would be a grief tool
rather than a convenience.
Settings
All on the server, and every one read on the tick it is used:
- reach — 6 blocks by default, from 1 to 32
- mode —
TAKENputs things straight into the inventory;DRAWNpushes them toward
you to be picked up the ordinary way, which is better to watch and can miss - experience — whether orbs are pulled as well as items
- held only — whether the magnet has to be in a hand rather than anywhere in the
inventory (a worn one still counts) - tick interval — how often the sweep runs, for a busy server that wants to turn it
down
Under it
The pull is decided on the server and nowhere else. Where a dropped item is, is world
state, and a client that moved items on its own would disagree with the server about who
picked up what.
Nothing here reimplements picking something up. Items and orbs already know how to give
themselves to a player, through playerTouch, which handles the pickup delay, whose the
item is, the sound, the advancement, the pickup events other mods listen for, and, for an
orb, mending before experience. The mod only decides what is in reach; everything after
that is vanilla’s own. One consequence: orbs are absorbed at the rate the game absorbs
them when walked over, so a magnet gathers experience without hurrying it.
Requirements
NeoForge on Minecraft 1.21.1. Curios is optional. MIT licensed.
日本語
Magnes は磁石を追加します。持ち歩くと、届く範囲に落ちたアイテムと経験値オーブが、歩いて触れるのを待たずに寄ってきます。
インベントリのどこにあっても効き(手に持たなくてよいことが要点です)、右クリックでオンとオフを切り替えます。
磁石
鉄インゴット4個とレッドストーンブロック1個を、磁石の形そのままに並べます。
I I
I I
R
オンのときはカラー、オフのときはグレーで描かれ、切り替えの音もオンは高く、オフは低く鳴るので、見なくても区別できます。
ツールチップには届く距離が出ます。
Curios が入っていれば charm スロットに身に着けることもでき、身に着けた磁石は手に持っているものとして数えます。Curios は任意です。
磁石が無ければ何も起きません。 全プレイヤーに磁力を持たせたいなら、[magnet] の needed = false を設定してください。
その場合、アイテムは飾りになります。
取らないもの
拾えるまでの待ち時間がまだ残っているアイテムには手を出しません。この待ち時間があるからこそ、そもそもアイテムを捨てられます。
これを無視すると、投げた瞬間にすべて取り返してしまいます。死んだばかりの他のプレイヤーのドロップに手が届かないのも、この待ち時間のおかげです。
部屋の向こうから他人の持ち物を引き寄せる磁石は、便利道具ではなく嫌がらせの道具になってしまいます。
設定
すべてサーバー側の設定で、どれも使うそのティックに読みます。
- 届く距離:既定は6ブロック、1〜32
- 引き寄せ方:
TAKENはインベントリへ直接入れます。DRAWNはプレイヤーの方へ飛ばして通常どおり拾わせます。
見栄えは良いものの、取りこぼすことがあります - 経験値:アイテムに加えてオーブも引き寄せるか
- 手に持つときだけ:インベントリのどこでもではなく、手にあるときだけ効かせるか(身に着けた磁石は効きます)
- 走査の間隔:負荷を下げたいサーバー向けに、走査の頻度を落とせます
中身
引き寄せはサーバーだけで決めます。落ちているアイテムの位置はワールドの状態で、クライアントが独自に動かすと、
誰が何を拾ったかでサーバーと食い違うためです。
拾う処理は自前で書いていません。アイテムもオーブも playerTouch を通じて自分をプレイヤーに渡す方法を既に持っていて、
そこで拾えるまでの待ち時間、持ち主、効果音、進捗、他の Mod が聞いている拾得イベント、オーブなら経験値より先の修繕が扱われます。
この Mod が決めるのは「何が届く範囲にあるか」だけで、その先はすべてバニラの処理です。
そのため、オーブは歩いて触れたときと同じ速さで吸収されます。磁石は経験値を集めはしますが、急がせはしません。
動作環境
Minecraft 1.21.1 の NeoForge。Curios は任意。MIT ライセンス。
常见问题
Magnes 支持哪些 Minecraft 版本?
Magnes 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。
Magnes 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Capsicum0907 的其他作品
查看全部 →Angelus
One block that needs nothing to be placed against: right-click into open air and it appears in front of you, so a walkway can be built out over nothing or down into water. It breaks in one hit and comes back to your hand rather than falling on the floor.
Altitudo
A world type that runs the Overworld from -2032 to 2031 and the Nether from -128 to 1023. Caves, ore and the Nether's roof follow the new bounds, and other mods' ores travel with them.
Laterna
Light sources in all sixteen dye colours: lamps, slabs, panels, bulbs, fixtures, rods, a cased lamp, and a recessed spotlight with no thickness at all. Every frame follows its lamp's colour, or stays fixed black or white.
Caldarium
Generators, batteries, chargers and cables for Forge Energy. Nine generators that each run on something different, eight tiers, and an artificial sun that powers solar panels day and night.
评论
登录后评论和评分