Solved Zoom in.

Discussion in 'Plugin Development' started by bodhistrontg, Dec 23, 2013.

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

    bodhistrontg

    Code:java
    1. @EventHandler
    2. public void onWeaponUse(PlayerInteractEvent e){
    3. Player p = (Player) e.getPlayer();
    4. if(!(e.getAction() == Action.LEFT_CLICK_AIR)) return;
    5. if(!(e.getItem().equals(sniper))) return;
    6. }

    So i wanted to know how to make it so if the player is (dont know how) shifting (know) and they left clicked air and the weapon equals sniper (dont know) it zooms in like optifine and ctrl. Thank you. Sorry i was looking through bukkits meathods and i can't find anything is it even possible?
     
  2. Offline

    reider45



    I've seen this on some servers, not to the extent of the optifine zoom, but try a resistance potion maybe, I think that may work

    EDIT: Like DrJava said it might be a slowness potion
     
    bodhistrontg likes this.
  3. Offline

    DrJava

    Give a player a slowness potion of 10.
     
    bodhistrontg likes this.
  4. Offline

    bodhistrontg

    I'm pretty sure i've seen it on a server before on mc-war.com

    reider45
    How bout getting if they player is shifting? And when they let go of left click it will remove the potion effect im sorry im not so good at bukkit yet just finished learning and pratacting java 3 weeks ago

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

    DrJava

    @bodhistrontg If you don't want particles you could also use player.setWalkSpeed(0.2F);.

    isShifting();

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
    reider45 and WarmakerT like this.
Thread Status:
Not open for further replies.

Share This Page