[2.0.76] LuaPrototypes#get_item_filtered documentation bug

Place to get help with not working mods / modding interface.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 186
Joined: Tue Feb 06, 2024 5:18 am
Contact:

[2.0.76] LuaPrototypes#get_item_filtered documentation bug

Post by hgschmie »

https://lua-api.factorio.com/latest/cla ... m_filtered states
Screenshot 2026-05-11 at 19.10.07.png
Screenshot 2026-05-11 at 19.10.07.png (60.41 KiB) Viewed 161 times
However, within the debugger I get
Screenshot 2026-05-11 at 19.10.45.png
Screenshot 2026-05-11 at 19.10.45.png (70.6 KiB) Viewed 161 times
because the correct field name is 'filter', not 'filters'
Last edited by hgschmie on Tue May 12, 2026 5:27 pm, edited 1 time in total.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4539
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.76] LuaPrototypes#get_items_filtered documentation bug

Post by boskid »

You seem to be confused with 'filter' from https://lua-api.factorio.com/latest/con ... ilter.html and 'filters' parameter. This method does not take named parameters, it directly takes one parameter which is a table. Name "filters" should not appear here in your code.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 186
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Re: [2.0.76] LuaPrototypes#get_item_filtered documentation bug

Post by hgschmie »

I think I get what you are saying. Basically, it should be

prototypes.get_item_filtered { { filter = 'type', type = 'fuel' }, } and not prototypes.get_item_filtered { { filter = 'fuel' }, }

That makes me curious why the second form worked at all.
Post Reply

Return to “Modding help”