allow player to block while looking at horses

Discussion in 'Spigot Plugin Development' started by NoobDoesMC, Jul 19, 2018.

  1. hold a sword, look at a horse, try to block

    it's not possible

    catching PlayerInteractEntityEvent and cancelling it doesn't allow players to block it
     
  2. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Unfortunately, it's not possible. It's a clientside issue (I would even say bug) that's the problem here.
     
  3. Can I set "flags" on the horse?

    I think it is possible with skelly horses
     
  4. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Is the issue where it sets the player's looking direction as well as not being able to block?
     
  5. The problem is that a player can't activate and hold the block while looking at a horse

    I detect the right click, normally with PlayerInteractEvent but I have to use PlayerInteractEntityEvent for horses, to see when the block starts

    the I have a bukkitrunnable to "charge" something until the player is no longer blocking (player.isBlocking)

    the problem is when looking at a horse, player.isBlocking can't be true
     
  6. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Yeah, unfortunately that's a clientside issue. The client isn't telling the server they're blocking, so the best you can do is guess if they are. But then you won't be able to tell when they've stopped blocking.
     
  7. But I'm pretty sure I can block while looking at a skelly horse?
     
  8. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Because the client treats it differently.