AiBudget 5.46.0
Server-wide limits on mob AI work per tick (pocketmine.yml "mobs" section).
Mobs over the AI update budget keep following their current path and look target, but don't evaluate new goals until a later tick. Path searches over their budget are retried by the navigator on a later tick.
Constants
DEFAULT_MAX_AI_UPDATES_PER_TICK
php
public const DEFAULT_MAX_AI_UPDATES_PER_TICK = 200DEFAULT_MAX_PATH_SEARCHES_PER_TICK
php
public const DEFAULT_MAX_PATH_SEARCHES_PER_TICK = 10Methods
configure()
php
public static function configure(bool $enabled, int $maxAiUpdates, int $maxPathSearches, int $maxPathNodes = 400, bool $requireNearbyPlayer = true) : voidOverrides the configuration (tests, plugins).
getMaxPathNodes()
php
public static function getMaxPathNodes() : intisEnabled()
php
public static function isEnabled() : boolWhether mob AI runs at all (mobs.enabled).
load()
php
public static function load(\pocketmine\Server $server) : voidrequiresNearbyPlayer()
php
public static function requiresNearbyPlayer() : boolWhether mobs only run their AI with a player nearby (always true on a server; tests turn it off).
tryAiUpdate()
php
public static function tryAiUpdate(int $currentTick) : boolTakes one full AI update (goal evaluation) from this tick's budget. Returns false if it's exhausted.
tryPathSearch()
php
public static function tryPathSearch(int $currentTick) : boolTakes one path search from this tick's budget. Returns false if it's exhausted.
