Hands-On Usage
has_resources_amount commonly appears in resource-related decision unlock conditions, national focus availability checks, and dynamic event triggers (for example, "allow construction of a specific factory only when chromium reserves in a state exceed a threshold"). Combined with the delivered = yes parameter, it can also check actual delivery amounts, making it suitable for creating resource shortage warning events or production capacity evaluation logic in colonization mods.
# Example in decision available block: execution allowed only if chromium delivery exceeds 10
available = {
has_resources_amount = {
resource = chromium
amount > 10
delivered = yes
}
}
Synergy
[resource_count_trigger](/wiki/trigger/resource_count_trigger): Both are resource-type triggers; resource_count_trigger operates at the nation scope for aggregation, while has_resources_amount operates at the state scope for precise checks. Combining both allows you to create a "dual threshold" condition: national total meets quota AND critical state has sufficient local reserves.
[is_owned_by](/wiki/trigger/is_owned_by): In cross-national mod logic, it's common practice to first use is_owned_by to confirm the sovereignty of the target state, then use has_resources_amount to verify resource amounts in that state, preventing the condition from being evaluated against the wrong owner.
[add_resource](/wiki/effect/add_resource): Used as a follow-up operation in effect blocks—first check with has_resources_amount whether resources fall below a minimum threshold, then replenish with add_resource, creating an "auto-adjust if below threshold" logic loop.
[has_state_category](/wiki/trigger/has_state_category): Resource output is often tied to state size; checking state category simultaneously filters out small states, making trigger conditions more aligned with design intent.
Common Pitfalls
- Comparison operators must be written on a separate line from the field, meaning
amount > 10 is the correct format. Beginners often mistakenly write amount = > 10 or directly assign a value to amount (like amount = 10), where the latter semantically means "exactly equal to 10" rather than "greater than 10", causing the condition to almost never evaluate to true.
- Forgetting the distinction between
delivered default value semantics: By default, delivered = no checks the state's raw reserves (static value including unexploited potential), not the actual quantity the controlling nation receives. If your mod logic cares about "resources the player actually has available", you must explicitly add delivered = yes; otherwise, resources could be completely blockaded yet still be falsely judged as "sufficient".