Skip entity tick process depending on the distance to player
As a datapack maker, I like to enhance Mob AI to make game more difficult. But use command to control mob AI involve many detection and scoreboard recoding and as game become more difficult, mob that stack together will kill player in second. So I make a mod to deal with these problem
To deal with the problem. First is to improve the performance by skip entity tick when player is far away, next is to remove entity when other entity nearby unloaded.
Remember to register chunks where your machine and farm located or it may break the farm that require the entity and redstone running at the same speed and decrease the efficiency of entity resources farm such as wool farm and the farm that assemble mob like most of the mob spawner do. Skip tick means no calculation will be operated on entity, and thus they won't even move.
Clear entity in group may clear some entity that usually should be in certain structure like Boss from other mod.(vanilla ones like evoker has been avoided)
450 pigs test
Open : 12fps / 130~140ms
Close : 12fps / 130~140ms
Open : 40fps / 120ms
Close : 40fps / 108ms
When within 24 blocks, they are almost the same.
Open : 40fps / 95ms
Close : 40fps / 108ms

Open : 60fps / 85ms
Close : 60fps / 120ms
TPS drops since the higher fps requirement
Open : 60fps / 42ms
Close : 58fps / 75ms

Open : 70fps / 32ms
Close : 60fps / 75ms

Conversation