Types/DamageTypeFilters

From Official Factorio Wiki
Jump to navigation Jump to search

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/DamageTypeFilters.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.


Either a dictionary (Types/table) with the below properties, an array (Types/table) of names of Prototype/DamageTypes (Types/strings), or one name of a Prototype/DamageType (Types/string).

Mandatory properties

types

Type: Types/string or Types/table (array) of Types/string

Default: false

Name or names of Prototype/DamageTypes.

Optional properties

whitelist

Type: Types/bool

Default: false

Whether this is a whitelist or a blacklist of damage types. Defaults to being a blacklist.

Examples

A single damage type filter to blacklist fire can be specified in the following 4 different ways:

damage_type_filters = "fire"
damage_type_filters = { "fire" } -- more damage types could be specified here
damage_type_filters = 
{
  whitelist = false, -- optional
  types = "fire"
}
damage_type_filters = 
{
  whitelist = false, -- optional
  types = { "fire" } -- more damage types could be specified here
}