-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
Snapshot-24w12a
-
Yes
Since the last snapshot we have extensive, data-driven predicates for items now.
`RecipeChoice.ExactChoice` implements `Predicate<ItemStack>` but the API doesnt allow custom Predicate implementations as recipe choices, because it might lead to memory leaks when plugins register recipes with them.
How much sense would it make to have an API layer for item predicates, like an actual `ItemPredicate` class.
Since items will now be completely composed of components, the implementation shouldnt be too hard.
This would allow for recipe choices like `*[damage~\{durability:{min:3}}]` => any item which has at least 3 uses left
And even for custom data predicates (since that is also just a component now).
I would first have to look into nms and see what they serialize those predicates into, before making a more concrete suggestion or even implementation. I just wanted to write this down somewhere.