How can I enforce first person view in Minecraft 1.12.2?

Solution 1:

You cannot do this using commands because third person is a client POV. However, you can give yourself invisible blocks with the: " /give your username barrier " command by writing it in the chat. (That is, assuming you have access to commands.) Once you have these barrier blocks, you place them one block above the player everywhere you do not want the player to have f5 mode. You see, barrier blocks are invisible, but they have a collision blocks: they count as solid blocks. There are advantages and disadvantages: when the player enters third person, their view will be blocked like they had a block above their heads, even though it looks like they don't. However, they can still use it horizontally.