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

Solved Changing Projectile shooting speed

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

  1. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    Is there any magical way to change the Projectile shooting speed ?
    I mean Snowball!
    I want to reduce the time between two Snowball shooting..
  2. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    $motion 2;
    $snowball->setMotion($snowball->getMotion()->multiply($motion));
  3. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Thats not magical...
  4. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    That changes the Flying speed, not Shooting speed.
    The time between two snowball wasn't changed.
  5. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    I don't think it can be changed, as it's internal MCPE
    Inta likes this.
  6. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    That's what i expected. Just to make sure so..
  7. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    To get a player yaw independet speed do:

    PHP:
    $yaw $entity->yaw M_PI 180;

    $x cos($yaw);
    $z sin($yaw);


    // To add pitch to it

    $pitch $entity->pitch M_PI 180 * -1;

    $y sin($pitch);
    $x cos($yaw) * cos($pitch);
    $z sin($yaw) * cos($pitch);

    $entity->setMotion(new Vector3($x$y$z));

    // you can multiply it with whatever you want

Share This Page

Advertisement