Screen upside down

Discussion in 'Spigot Plugin Development' started by Rocky2434d222, Mar 12, 2018.

  1. is it possible to flip the screen of player upside down? with super secret settings? or can you apply any super secret settings to a player?
     
  2. The only thing that I can imagine here: Spawn an armor stand with its head upside down, and set the player in gamemode.SPECTATOR to spectate that armorstand... No clue if that would work though lol
     
    • Like Like x 1
    • Creative Creative x 1
  3. Hmm... That is quite an interesting idea... I'll have to test that later.

    Also, using a few packets it's possible to have the client "spectate" an entity without actually being in spectator mode, so if the armor stand does work, you can write a custom AI for the armor stand that lets it be "driven" like a vehicle by the client. This way they can still move and still have the same interface rather than the player selector hotbar.
     
    • Creative Creative x 1
  4. Woah.
     
  5. Choco

    Moderator

    No, pitch is up and down, yaw is left and right, roll is what you're thinking of in which the player's head is rotated along its z axis. This is something you cannot modify. If you wanted to do this, you'd have to do it with an armour stand with its roll set to 180. Fairly certain I've seen someone do this before.
     
  6. thank you good you please send me an example code?
     
  7. Choco

    Moderator

    I was going to say... if this wasn't done with a client mod, I'd have been impressed. I can't think of a single way to accomplish that on the server alone. Always open for an opportunity to learn though, so do you have the client code that does that? I can't imagine it's more complicated than just manipulating the roll value of the head portion of the player model
     
  8. Choco

    Moderator

    Any particular reason as to why the chat window has to be open? That's a seemingly random caveat
     
  9. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    I just recently managed to make a player's viewpoint go upside down, actually by accident when I got a few figures off in my math. Basically it's just spectating an armorstand and rotating it's yaw, since the armorstand is the only entity that can go beyond looking straight up.

    Good idea, but unfortunately spectating an entity is almost 100% clientside. In fact, the server doesn't even know whether or not a player is spectating an entity, it can only keep track of when they start/stop spectating. Basically, when the client receives the camera packet is just copies every movement and look packet sent to them from the server for that entity, and copies it.

    Unfortunately, the trick of mounting a spectator and getting movement packets won't work, the client ignores movement and look controls so they're never even sent to the server.
     
  10. Choco

    Moderator

    Are you sure? Because Player#getSpectatorTarget() gets the entity being spectated by the player. That's not me proving you wrong, I'm just genuinely curious and would love an explanation.
     
    #10 Choco, Mar 12, 2018
    Last edited: Mar 12, 2018
  11. I think a few versions back there was a certain potion effect, I think speed, that derped out when you set the value to high. When you started sprinting, your screen would flip upsidedown. Pretty sure they patched that though.

    I think that armor stands / spectator view are your best bet as mentioned before.
     
  12. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    It's basically just storing the state judging from what they were last known to be in. If you sent a camera packet, for example, spectatorTarget() would not return the target of the packet (unless the Bukkit API captures outgoing packets like that).
     
    • Like Like x 1
  13. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    I think setting the FOV high enough had that effect, and you could give a speed effect that would set the FOV high enough to go upside down. Unfortunately, the spectator route will freeze the player completely, you can't get any kind of input except the shift key.
     
  14. Oh, I remember now, it was the FOV yeah. Hm, well, you can't really modify a player's client settings from the server, at least not the FOV.
     
  15. Speed potions modify FOV
     
  16. FrostedSnowman

    Resource Staff

    • Useful Useful x 1
  17. I remember writing a client mod to do that once. The problem is that when you move your mouse to update the screen rotation, the client sanity checks the rotation and makes you no longer be rotated upside-down. So you open a window or sth like that so mouse input handling is skipped (ie reditected to the gui).
     
    • Informative Informative x 1