About Module category defaults
From Factorio Mod PortalMakes vanilla module categories the default allowed_module_categories for entity prototypes.
Module Category Defaults
This library mod sets the vanilla module categories as allowed_module_categories for all applicable entity prototypes that do not have that field already set by another mod. This allows blacklisting special modules when a mod needs to define its own rules for including them.
In effect, this mod inverts the engine's behavior for modded module categories: instead of being allowed for all entities by default, all modded module categories will be _disallowed for all entities by default_. Modded module categories can be added to this mod's list of default categories, which will cause them to be treated as if they were vanilla categories (i.e. enabled by default). The same can also be done for recipes; this is not done automatically, but only if another mod requires it.
Mod Support
In the data stage, the global table ModuleCategoryDefaults is made available. Most importantly, it contains a table default_categories that will be used to apply the defaults. Add or remove values to change the outcome of this mod. You probably want to add your custom category that you want to be available to all regular machines. ModuleCategoryDefaults also has a few additional tables and functions, which are explained in the examples.
This mod makes all its changes in data-final-fixes. Default categories should be added in your mod's data or data-updates. Any logic that depends on allowed_module_categories being set should be in your mod's data-final-fixes, and may require an additional step for compatibility safety (explained in the examples).
Example: My mod adds a module category for all buildings to use.
- Add
module-category-defaultsas a dependency to your mod. - Add your module category to the defaults table:
table.insert(ModuleCategoryDefaults.default_categories, 'my-module-category').
Done. The module(s) will be available the same as without this mod. This must be done in either data or data-updates.
Example: My mod adds a special module for a special building.
- Add
module-category-defaultsas a dependency to your mod. - Add your special module category to the
allowed_module_categoriestable for each of the special buildings, as you would normally do.
Done. No other buildings will be able to use the module. You do not need to touch ModuleCategoryDefaults or the allowed_module_categories table of any other entity prototypes. This must be done in either data or data-updates.
Example: My mod adds a special module that should be used in _no_ buildings.
- Add
module-category-defaultsas a dependency to your mod. - Add your module category to the restricted categories table:
table.insert(ModuleCategoryDefaults.restricted_categories, 'my-module-category').
Done. No buildings will be able to use the module. This must be done in either data or data-updates.
Highlights
From source dataGame versions
Built for Factorio 2.1.
Footprint
Rated a light load on a server.
License
Published under MIT.
Module category defaults on Nxeon
From our catalogue- One-click install
- Supported on Nxeon Factorio servers. We download it from Factorio Mod Portal, place it, and restart the server.
- Server side
- Required on the server
- Server load
- light
- Smallest plan we suggest
- Factorio — 2 GB (2 GB RAM). This follows our own load rating above, not a benchmark.
- Latest build
- 2.2.0, released 2026-08-03
Run Module category defaults on a Factorio server
Pick a server or deploy a new one above; it is installed in one click.
What kind of mod it is
From the catalogGameplay & overhauls
New mechanics, content and overhauls that change how the game plays.
Runs on your server
From source side supportFactorio Mod Portal lists Module category defaults as required on the server. Check its Factorio Mod Portal page to see whether players need it too.
Compatibility
- Game
- Factorio
- Runs on
- Serverrequired on the server
- Game versions
- 2.1
Verified at the source
- ✓Factorio Mod PortalOfficial listing, checked 2026-10-08Open ↗
- ✓Authorthremtopod, as published on Factorio Mod Portal
- ✓LicenseMITFree
