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

How to remove Gravity of Snowball?

Discussion in 'Plugin Help' started by Howtodoit, Oct 8, 2020.

  1. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    I want to remove Gravity of snowball.
     
  2. AsponPL

    AsponPL Spider Jockey

    Messages:
    47
    you have to make class with this code:

    PHP:
    <?php

    namespace your_namespace;

    use 
    pocketmine\entity\projectile\Throwable;

    class 
    Snowball extends Throwable{
        public const 
    NETWORK_ID self::SNOWBALL;
        public 
    $gravity 0;
    }

    then in function onEnable() put this code:

    PHP:
    Entity::registerEntity(Snowball::class, true);
     
  3. OguzhanUmutlu

    OguzhanUmutlu Witch

    Messages:
    63
    GitHub:
    OguzhanUmutlu
    PHP:
    public function entitymove(EntityMotionEvent $e) {
        if(
    $entity instanceof Snowball$e->setCancelled(true);
    }
     
  4. AsponPL

    AsponPL Spider Jockey

    Messages:
    47
    it'll stop snowball move, he want to remove gravity
     
  5. OguzhanUmutlu

    OguzhanUmutlu Witch

    Messages:
    63
    GitHub:
    OguzhanUmutlu
    sorry
     
  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.