recreating bendable piston datapack

i want to recrite this bendable piston in my datapack but i want to make it from scratch, can you guys suggest an strategy that i can use?

https://mcmakistein.com/creations/crazy_features

Continue to help post