Hmm... Maybe it would be possible if the parameter to the getAsItemStack function would be the requested stack, and it would return the matching ItemStack if such an ItemStack exists, or just some other ItemStack if it doesn't. Is that what you meant?