How to disable blocking with a sword !

Discussion in 'Plugin Development' started by Jace_oio, May 18, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Jace_oio

    Hi,

    How would I be able to disable blocking with a sword ?

    Any help is appreciated :)

    - Best wishes Jace_OiO :) !

    Any one ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  2. Offline

    felixfritz

    I think that the PlayerMoveEvent is also called, when a player starts blocking with a sword. So you could try to listen for that event, check with an if-statement, if the player is blocking (if(player.isBlocking()), then just cancel the event.

    Tell me, if that worked! :)
     
  3. Offline

    Jace_oio

    felixfritz Sorry for the late reply :oops:

    I will go test now !

    felixfritz It did not Work :( but thanks for your post :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  4. Offline

    TheDeathMachine

    Jace_oio i think it might be this:
    PlayerInteractEvent check if the action equals right click air or a block and if the item in hand equals a sword.
    If so, cancel the event
     
  5. Offline

    ZeusAllMighty11

    You can not disable it, as it is client-side animation. However, you can calculate the damage done with each sword while blocking and while not, and implement that algorithm
     
  6. Offline

    TheDeathMachine

  7. Offline

    Ivan

    use the EntityDamageEntityEvent and player.isBlocking();
     
  8. Offline

    Jace_oio

    Oke thanks Guys ! :)
     
Thread Status:
Not open for further replies.

Share This Page