Minecraft command: bring something and get it back (1.15.2)?

Cl
2

I have a question. Is it possible to build a command in minecraft that you bring something to a person and then give something back.

For me it looks like this: As a player you have to bring a mushroom to a villager, that should then trigger a command that you get what you get back with the / give command or something.

Does anyone know how to do that?

Av

Just do a Villager trade. You can do that on MC-Stacker, you should find a tutorial on YouTube. Just search for "Minecraft villager own trades" or something like that.

Cl

Okay thanks