Entity Despawn (Effect) — Skript
Addon: Skript · Category: Effect · Since: 2.11
Syntax
make %livingentities% despawn[able] (on chunk unload|when far away)Description
Make a living entity despawn when the chunk they're located at is unloaded. Setting a custom name on a living entity automatically makes it not despawnable. More information on what and when entities despawn can be found at <a href="https://minecraft.wiki/w/Mob_spawning#Despawning">reference</a>.
Examples
make all entities not despawnable on chunk unloadspawn zombie at location(0, 0, 0):
force event-entity to not despawn when far away