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
EntityTickFunctionto refer to the host entity, bypassing the overhead of running (relatively) expensive
@eselectors 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
EntityTickFunctionthat replaces/removes itself once complete.
- Automatically run multiple (non-nested) functions on an entity every tick by specifying
EntityTickFunctionto be one of those fancy new function tags.