1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Want to change value of losing food when player sprint

Discussion in 'Development' started by Nora1903, Jun 19, 2018.

  1. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Like title, i want to change amount of food will be lost when player sprint using PlayerToggleSprintEvent event. Can anyone give me example ?
    Thanks
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Use PlayerExhaustEvent
    PHP:
    /** @var PlayerExhaustEvent $event */
    if($event->getCause() === PlayerExhaustEvent::CAUSE_SPRINTING){
        
    //$event->setAmount(int);
    }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.