Throw Event?

Discussion in 'Development' started by ethaniccc, Mar 26, 2020.

  1. ethaniccc

    ethaniccc Witch

    Messages:
    60
    GitHub:
    ethaniccc
    Is there some sort of throw event for snowballs? I want to add particle trails to it so yeah....
    Thanks in advance :)
     
  2. kriskotooBG

    kriskotooBG Spider Jockey

    Messages:
    33
    GitHub:
    kriskotoobg
    Yup! Its
    PHP:
    ProjectileLaunchEvent
    For more info: Github: Projectile Launch Event

    Example:

    PHP:
    use pocketmine\entity\projectile\Snowball as SnowballProjectile;



    onSnowballThrow(ProjectileLaunchEvent $e){
        if(
    $e->getEntity() instaceof SnowballProjectile){
            
    //your code here
        
    }
    }
    Note: Don't forget to register your listener ;)
     
    ethaniccc and HimbeersaftLP like this.
  3. ethaniccc

    ethaniccc Witch

    Messages:
    60
    GitHub:
    ethaniccc
    Hehehe TY :D
     

Share This Page

  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.