selection_priority does not always default to 50
Posted: Fri Feb 27, 2026 11:08 am
i ran into an issue working with loaders that their selection priority was 45 instead of the default/assumed 50.
we modders often use (entity.selection_priority or 50) + 1 to make sure something is above or below a certain entity, but there are a bunch of exceptions.
i found 3 of those that are documented, though one of which is an override:
https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority
however as SelectionPriorities in EntityPrototype.hpp around line 513 suggests there are more exceptions, like 45 for belt stuff, 40 for ores, etc.
(and possibly mention that in entity-util.lua there's a premade list referencable by lua, i was not even aware it existed until the comment pointed it out)
we modders often use (entity.selection_priority or 50) + 1 to make sure something is above or below a certain entity, but there are a bunch of exceptions.
i found 3 of those that are documented, though one of which is an override:
https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority
however as SelectionPriorities in EntityPrototype.hpp around line 513 suggests there are more exceptions, like 45 for belt stuff, 40 for ores, etc.
(and possibly mention that in entity-util.lua there's a premade list referencable by lua, i was not even aware it existed until the comment pointed it out)