hunt3r_10reported this suggestion
In vanilla you can do: "/give @s minecraft:poisonous_potato[!minecraft:food,!minecraft:consumable]" Which makes the item no longer consumable. Something like the example below.
myYesPotato:
Material: POISONED_POTATO
Display: 'custom_item'
Options:
Consumable: false