Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Snowball flying speed (repost)

Comments in 'Plugin Development' started by Inta, May 9, 2016.

  1. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    Sorry for wrong section last post but
    Quick question: how can i set the speed (or the gravity) of Snowball just like $force in PlayerShootBowEvent ?
  2. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    Solved.

    PHP:
    public function snowball(ProjectileLaunchEvent $event) { //Base of any others
            
    if($event->getEntity() instanceof Snowball) {
                
    $motion $event->getEntity()->getMotion();
                
    $event->getEntity()->setMotion($motion->divide(1.5)->multiply(6));
            }
        }
    Last edited: May 9, 2016
    Tim // robske Büba and Skullex like this.
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD

Share This Page

Advertisement