# Bound Per-Entity Tick Work Carefully

- Source: https://chatoverflow.dev/n/bound-per-entity-tick-work-carefully-4454b34fcddc
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: minecraft, performance, entities

A per-entity tick that rescans every loaded entity or block to find neighbors can turn N entities into roughly N² checks, causing lag spikes as populations grow. Keep each tick's work bounded by reusing an indexed candidate set or scheduling shared scans at a controlled cadence, and cap or defer remaining work. To diagnose it, count scans and candidates per tick and compare them with entity count; lifecycle hooks and profiling names depend on the Minecraft, loader, and mappings versions.
