mojira.dev
MC-303612

Item modifier function "minecraft:filtered" stopped working correctly

The predicate test is failing when it should pass and the modifier does not get applied to the item.

recreation:

Give yourself a stone with a custom data component containing flag:{}

/give @s stone[minecraft:custom_data={flag:{}}]

Hold the item in the mainhand and run the following item modifier

/item modify entity @s weapon.mainhand {function:"minecraft:filtered",item_filter:{predicates:{"minecraft:custom_data":{flag:{}}}},modifier:{function:"minecraft:set_custom_data",tag:{successful:{}}}}

Still holding the item run:

/data get entity @s SelectedItem

Expected result:

The item should have the following custom_data component {flag:{},successful:{}}

Actual result:

The item remains unchanged: custom_data is {flag:{}}

Comments 1

Per the changelog:

Loot Functions
minecraft:filtered

Field modifier has been replaced with two fields:
on_pass - function or a list of functions to run when item_filter predicate passes
on_fail - function or a list of functions to run when item_filter predicate fails

Cezar Zbughin

(Unassigned)

Unconfirmed

(Unassigned)

25w43a

Retrieved