EntityTickFunction: A function defined via entity data that runs once per tick using the entity as the executor
The title says it all. Similar in ways to the old gameLoopFunction but for individual entities.
Here's some inspiration:
- Conveniently use
@s
in theEntityTickFunction
to refer to the host entity, bypassing the overhead of running (relatively) expensive@e
selectors at 20Hz. Great for systems like custom AI that need to be as responsive as possible while remaining efficient. - Trivially - and slightly more efficiently - run one-time initialization functions on newly-spawned mobs by summoning them with an
EntityTickFunction
that replaces/removes itself once complete. - Automatically run multiple (non-nested) functions on an entity every tick by specifying
EntityTickFunction
to be one of those fancy new function tags.