Minecraft armorstands knock you back?

El
3

I'm currently doing something with command blocks and I want to prevent an armorstand from letting the player through, like a barrier block.

Why not a barrier? Very easily. I need the armor stand between two blocks and not in the middle of a block: /

Maybe someone has an idea.

Ca

Thorn armor can be made to push you back when you hit them, which is probably very complicated.

El

Hmm. Unfortunately, that doesn't help me because I want to make an object that will stop the player

Ca

So in what way? Do you just want a 2x? X1 block gate or what?