How to make a sit Datapack

I want to make a sit Datapack that i can sit on everywhere like ground,bed and etc by right clicking on them. how can i do it? and also can someone tell me how to use the set nbt function in an item modifier?

Continue to help post