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 And making the player slow would be great too but it is not as important to me. Thanks for reading this -trg601.
Thanks so much 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.
You can try either setWalkSpeed() in Player or send the potion effect with packets, and not use it on the server.
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..
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.