modify(e, 'home')

View on GitHub

Syntax

modify(entity, 'home', null)
modify(entity, 'home', block, distance)
modify(entity, 'home', x, y, z, distance)

Sets AI to stay around the home position, within distance blocks from it. distance defaults to 16 blocks. null removes it. May not work fully with mobs that have this AI built in, like Villagers.