Page 1 of 1

[2.1.9] CreatePollutionTriggerEffectItem fails to create pollution when use_entity_from_trigger=true and no entity

Posted: Fri Jul 03, 2026 10:07 pm
by wagyekk
CreatePollutionTriggerEffectItem silently fails to create pollution when use_entity_from_trigger is true (default) and the trigger context does not provide a valid trigger entity.

Assign the following trigger to TilePrototype.default_destroyed_dropped_item_trigger:

Code: Select all

{
  type = "direct",
  action_delivery = {
    type = "instant",
    source_effects = {
      {
        type = "create-pollution",
        amount = 1000
      }
    }
  }
}
Enable destroys_dropped_items for the tile and drop an item onto it (e.g. into water).
Here's the code for mod that would reproduce the behavior:

Code: Select all

local effect = {
    type = "create-pollution",
    amount = 1000
}
if not settings.startup["test-use-trigger-entity"].value then
    effect.use_entity_from_trigger = false
end
data.raw.tile["water"].default_destroyed_dropped_item_trigger = {
    type = "direct",
    action_delivery = {
        type = "instant",
        source_effects = {
            effect
        }
    }
}
data.raw.tile["water"].destroys_dropped_items = true
Expected behavior

Pollution is created regardless of whether it is associated with an entity in the Pollution statistics.

Actual behavior

No pollution is created.

It's also possible that the API doc could be clarified. Currently it states:
use_entity_from_trigger :: boolean If not set, and entity is not set, the pollution does not show in statistics.
From this description, I expected that when no trigger entity is available, pollution would still be created, just without being attributed in the Pollution statistics. Instead, no pollution is created at all.

Re: [2.1.9] CreatePollutionTriggerEffectItem fails to create pollution when use_entity_from_trigger=true and no entity

Posted: Mon Jul 06, 2026 5:29 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.