Keep Away Aura

Quick rating

Community listing page, reviews may not be monitored by the author.

Keep Away Aura

By SansrusOwner

No reviews yet

Mobs and items within 30 blocks are pushed away from players

Mod Loaders
Minecraft
26.3 26.2

About

Description

Keep Away Aura

Mobs and dropped items within 30 blocks of a player are pushed away from the nearest one.

How it works

  • Every tick the pack sets the horizontal velocity of each mob and dropped item away from 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 push speed is constant: 0.15 blocks per tick (3 blocks per second), regardless of distance.
  • Only mobs and dropped items are pushed. Arrows, minecarts, boats, armor stands and other entities are left alone. The list lives in data/keep_away_aura/tags/entity_type/targets.json.
  • Players in spectator mode don't push anything.

Configuration

The speed is set in data/keep_away_aura/function/push.mcfunction, in two lines:

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

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

The radius is set in data/keep_away_aura/function/tick.mcfunction: distance=..30.

Run /reload after editing.

Limitations

  • Drops run away too. Items from mined blocks and killed mobs slide off at 3 blocks per second, while a walking player makes about 4.3: you can catch them or pin them against a wall, but gathering gets noticeably harder.
  • Melee mobs can barely reach a player: a zombie walks at about 2.3 blocks per second, slower than the push. Ranged mobs are unaffected.
  • Mobs' own AI still runs, so the push and their pathfinding fight each other.