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

Throw Event?

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

  1. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    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:
    46
    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 Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    Hehehe TY :D
     
  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.