跳到正文

Everything Clings

作者:Sansrus

Everything within 40 blocks is pulled toward the nearest player

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Everything Clings

Every entity within 40 blocks of a player slides toward the nearest one: mobs, dropped items, arrows, minecarts, TNT, everything except other players.

How it works

  • Every tick the pack sets the horizontal velocity of each entity toward the nearest player.
  • It’s real movement, not teleportation: entities collide with walls and keep falling and jumping normally, since only horizontal velocity is touched.
  • The pull speed is constant: 0.35 blocks per tick (7 blocks per second), regardless of distance.
  • Nothing is pulled while a player is within 2 blocks of it. Without this dead zone, mobs would keep ramming into the player and pushing them around.
  • Players in spectator mode don’t attract anything.

Configuration

The speed is set in data/everything_clings/function/pull.mcfunction, in two lines:

execute store result entity @s Motion[0] double 0.00035 run scoreboard players get #x everything_clings.calc
execute store result entity @s Motion[2] double 0.00035 run scoreboard players get #z everything_clings.calc

The multiplier is the speed in blocks per tick divided by 1000: 0.00035 = 0.35, 0.00015 = 0.15. Change both lines.

The radius and the dead zone are set in data/everything_clings/function/tick.mcfunction: distance=..40 and distance=..2.

Run /reload after editing.

Limitations

  • Bows, crossbows, tridents, snowballs and ender pearls barely work: a projectile’s nearest player is usually whoever threw it, so it turns back almost immediately.
  • Mobs’ own AI still runs. Skeletons trying to keep their distance and fleeing animals fight against the pull.
  • The pack touches every entity near players every tick. Hundreds of dropped items in one place can cost noticeable server performance.

常见问题

Everything Clings 支持哪些 Minecraft 版本?

Everything Clings 支持 Minecraft Java 版 26.1–26.3,共 5 个版本。下载时注意选择和你游戏版本一致的文件。

Everything Clings 怎么安装?

新建世界时在「数据包」里把下载的 .zip 拖进去;已有的存档,把文件放进存档目录下的 datapacks 文件夹,进游戏输入 /reload 即可生效。服务器同样放在世界目录的 datapacks 里。

评论

登录后评论和评分

Sansrus 的其他作品

查看全部 →