set adventure when entering structure

curious i wonder if its possible to make a datapack for when entering a structure will put you on adventure mode and leaving will put you back on survival
Continue to help post