How to snipe/zoom?

Discussion in 'Plugin Development' started by trg601, Aug 7, 2013.

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

    trg601

    I looked all over the place for this but annoyingly I mostly just found closed-source plugins and removed source codes :(

    What I want is to make a sniper rifle, I already made it so that it shoots arrows and takes arrows from your inventory, but I also want it to be able to switch zooming/sniping when you left-click.

    If you know how to do this please tell me :D
    And making the player slow would be great too but it is not as important to me.

    Thanks for reading this :D -trg601.
     
  2. Offline

    ZeusAllMighty11

    Adding slowness potion effects with certain amplifiers will give a 'zoom' effect.
     
  3. Offline

    trg601

    Thanks so much :D

    Now I have another problem... It zooms really well, but I can't move :/
    I am fine with slow movement but no movement is not okay!
    I tried adding a speed potion with a high amplifier but that didn't work :(

    Do you know how to set the speed of the player?

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

    epicfacecreeper

    You can try either setWalkSpeed() in Player or send the potion effect with packets, and not use it on the server.
     
  5. Offline

    blablubbabc

    They "fixed" it since 1.6.x .. Negative walk speed values are no longer possible (these created the extra wide zoom effect). If I am wrong, let me know of alternatives..
     
  6. Offline

    epicfacecreeper

    I was talking about for making the player faster after the potion was applied. I just don't know if that will override the slowness effect.
     
Thread Status:
Not open for further replies.

Share This Page