Is it possible to make a Player go only backwards?

Is it possible to make a Player go only backwards? - 2 Men in Red and White Jersey Shirt Sitting on Grass Field

I'm making an Adventure map (it has loads of command blocks), but I got stuck:
How can I make a Player to be able to go only backwards, that is, only when pressing the 'backwards' key, and to be able to change directions only with their mouse?
Any Redstone and Command Block circuit will do, It's not space limited. I don't want to install any mods, and I have Minecraft 1.9. Nothing moves the Player except the Player himself.

Is it possible to detect where a Player is looking and putting Barrier blocks on 3 sides from him?



Best Answer

Without mod or client consent to play fair I think this is NOT possible.

What would work:

You would need to override behaviour of keyboard input for directions you don't want to let clients use. That can be done by some mod, however you stated that you don't want to do so. And probably it would be kinda hard after all.

The second method is to define it as a map rule (so player goes to Option and disables said keys) and expect that they will do so , same as you expect they won't turn on cheats or break blocks.


The problem is that no command can compare player's look angle and his movement nor detect key presses. We can detect the final states of actions (change in XYZ, etc), but not HOW it was done (was the player pushed, or walked on his own?), because all that client sends in packets is the change of position, not the method how it was done.




Pictures about "Is it possible to make a Player go only backwards?"

Is it possible to make a Player go only backwards? - Pokemon Go Application on Smartphone Screen
Is it possible to make a Player go only backwards? - Crop barista pouring milk froth in cappuccino for client
Is it possible to make a Player go only backwards? - Man Sitting on a Grass while Holding Golf Club





Can You Beat Fallout New Vegas By Only Reverse Pickpocketing Explosives?




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Yogendra Singh, Pixabay, Ketut Subiyanto, cottonbro