Create

Create

86M Downloads

Nested filters don't properly respect allow and deny lists

usernamesarehard15 opened this issue ยท 3 comments

commented

If you put two of any filters inside a normal filter, one allowing some items and the other denying some of those items, the filter will just let any item through at all

Example:

  1. Get an attribute filter that allows (any) "is tagged #minecraft:fences"
  2. Get a second attribute filter that denies "is tagged #minecraft:wooden_fences"
  3. Put both these attribute filters into a normal filter
    Now you would expect this to let through any item that is tagged #minecraft:fences EXCEPT the ones also tagged #minecraft:wooden_fences, but now the filter just lets every item through
commented

This issue has been marked as stale because it has been inactive for 3 weeks. It will be closed if it remains inactive for another 3 weeks.

commented

This issue has been closed since it has been inactive for 3 weeks since it was marked as stale.

commented

I don't think that is what you should expect. Since the parent normal filter is on allow mode, it is supposed to be an 'OR', not an 'AND'. If I put item1 and item2 into a filter I expect it to match item1 OR item2. Similarly if I put two filters, it should match filter1 OR filter2. In your example, anything that is a fence OR is not a wooden fence should apply (and since every wooden fence is a fence, that simplifies to everything).

I wonder what happens if you put the parent filter on deny though, maybe DENY { deny fence, allow wooden fence } could actually work? (because on deny mode I expect it to be an AND). Either way, would be cool to have ways to define more complex filters with custom operators and conditions.