Broken down into their base aspects, they could be defined via something like this:
"interactions": [
{
"type": "item",
"interaction": "use", // alternative: "hit"
"consume": false,
"use_durability": 2, // if "consume"==false && has durability
"items": [ // one of list
{
"item": "namespace:some_item"
},
{
"tag": "namespace:some_tag"
}
],
"conditions": [ // optional
"target_specs": "form:some_form"
// + BetterSpawner conditions
],
"cooldown": 24000; // optional (ticks)
"effects": [ // mix & match
{
"type": "spec",
"specs": "palette:palette_name",
"revert": { // auto-reversion; optional
"ticks": 24000
// other conditions
}
},
{
"type": "drops",
"items": [ // like in drops files
{
"item": "namespace:dropped_item",
"min": 1,
"max": 2,
"chance": 1.0
}
]
},
{
"type": "convert_item",
// turns used item into:
"item": "namespace:returned_item"
}
]
}
]
Examples:
- Shearing (only possible when not in the shorn palette) sets the palette to shorn (via "spec" type effect) and drops a number of wool ("drops" type). It reverts to its previous palette either after some time, or via trigger.
- Milking uses the "convert_item" effect type to turn a Bucket into a Bucket of Milk (or Bucket of Lava on Camerupt) and has a cooldown.
- The inclusion of BetterSpawner conditions allows Starters to check for Moon Phase and Light Level when interacted with a Carved Pumpkin (which is consumed).
If numerical specs allowed subtraction and OT can be compared, the Lake Guardian Ruby enchantments can be done via this system (-> check spec in condition, reduce happiness/level in "spec" effect, convert used ruby). And If ingame day can be checked against, it can be used as a "revert" condition for Hoopa Unbound.
(Could technically do things like Stone or other interaction Evos this way as well, but I feel like that would be too much and separate them from how the other evo methods are declared...)
With a system like this in place it would be easy to implement more interactions with your Pokémon, like collecting honey from bee Pokémon, shearing vines or flowers from certain Grass Types, styling Furfrou, changing the Pokéball of your Pokémon, and more.
It also allows servers to set their own conversion items for special palettes, implement special "medicine" for stat buffs, apply specs like "unbreedable" all without additional plugins.
If the affected species is defined via the "target_spec" condition, these could be set globally as well, selecting by specific specs like "type", "generation" or "nature" (or simply unrestricted, for all).