How do I when a player clicks the item having a given speed?

Discussion in 'Plugin Development' started by ifreezptpt18, Aug 13, 2016.

?

How do I when a player clicks the item having a given speed?

Poll closed Mar 13, 2017.
  1. Put this code

    2 vote(s)
    100.0%
  2. Add this line

    1 vote(s)
    50.0%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. Offline

    ifreezptpt18

    Hi all, I'm still on one side of programming, so I created a menu and wanted to do to when you click on this item: He http://prntscr.com/c57br2 activate the speed the player, but I'm not able to do, I put the: p. setWallkSpeed (5); and does nothing, can you help me?

    PS: Sorry for my English but I am Portuguese, I push myself to the maximum.

    Code: http://prntscr.com/c57eem
    Image Server: http://prntscr.com/c57eii
     

    Attached Files:

  2. Offline

    N00BHUN73R

    @ifreezptpt18
    You can always add a potion effect of speed so when they click on it, they get like Speed V or something like that :p
     
  3. Offline

    ifreezptpt18

    Hello again,
    But oh no more no way to do?
     
  4. Online

    timtower Administrator Administrator Moderator

    What is wrong with a speed potion then?
     
  5. Offline

    ifreezptpt18

    There's no problem, I just want to do like that but I'm not getting, and because also I know of to do it that way just that..
     
  6. Offline

    Zombie_Striker

    @ifreezptpt18
    If you mean you do not know how to add potion effects, use this line:
    Code:
    Player p = the player
    p.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier));
    //Change type to SPEED
    //change duration to 20*seconds (i.e 2 seconds = 40, 4 seconds = 80)
    //change amplifier to  the power you want. Speed V = 5
     
  7. Offline

    ifreezptpt18

    Could you send me the code all please?
     
  8. Offline

    N00BHUN73R

    @ifreezptpt18
    Nobody here is going to spoon-feed you code just because you don't want to do it, or don't know how. You have to learn how to do it!
     
    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page