retire

public boolean retire(int maxTicks, Runnable onCapReached)

Opt-in death phase for owners whose script may finish work after the owner itself ends (an EliteMobs boss dying). Hosts that never call this keep shutdown unchanged.

Retiring stops the tick task, hook dispatch and zone watches, cancels every owned task that does not outlive the owner, and clears any pause. Owned tasks that outlive the owner keep running, and callbacks still run through invokeOwnedCallback. The full shutdown, with its owned cleanups, follows when the last surviving task ends, when maxTicks pass, or when the host calls it. If nothing survives, it happens now.

Return

true when the instance stays in the death phase, false when it is already shut down

Parameters

maxTicks

hard limit on the death phase, in ticks

onCapReached

runs once, before the shutdown, if the limit cuts surviving tasks; may be null