Looking Straight Down?

Discussion in 'Spigot Plugin Development' started by DireLegendDev, Jun 8, 2015.

  1. How do I check if a player is looking straight down? Is the key in the pitch? If so, how can I get the pitch and when the player is looking straight down is the pitch 0?

  2. This is all I have and it doesn't work!

    Code (Text):
    if (player.getLocation().getPitch() == 0) {

  3. Do some F3 minecraft debugging to find the pitch/yaw values when a player is looking down,
    If this doesn't work, the alternate method would be to get the players target block, with a 1 range, and check if that block is equal to the one they are standing on.
    • Like Like x 1
  4. Looking straight down gives a pitch value of 90, and a pitch value is a float, so please add the F.
  5. Also floats can be 0.0000001, which does not equal 0. Check if it's smaller than such a small value.
    • Agree Agree x 2
  6. What is the pitch value when looking straight up? I tried 180, 270, 360, none working.
  7. Open your minecraft client, press F3 and find the numbers yourself?
    • Agree Agree x 1
  8. They aren't shown in the f3 menu. However, I discovered it is -90 for anyone finding this thread needing help.
  9. It's in the F3 menu.. 100% sure.
    • Like Like x 1