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

Solved I dont know.

Discussion in 'Plugin Help' started by Howtodoit, Sep 14, 2020.

  1. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    i want to create zoom plugin so the plugin must Add slowness for Zoom When player sneaking.

    It not add Effect to player But it can send massage only.

    PHP:
    public function onSneak(PlayerToggleSneakEvent $event){
                
    $player $event->getPlayer();
        if(
    $event->isSneaking()){
                        
    $effect Effect::getEffect(2);
                        
    $effect->setAmplifier(10);
                        
    $effect->setVisible(false);
                        
    $effect->setDuration(100000000);
                        
    $player->addEffect($effect);
            
    $this->getServer()->broadcastMessage("You Do it");
            return 
    true;
            }
        if(!(
    $event->isSneaking())){
            
    $player->removeEffect(2);
            
    $this->getServer()->broadcastMessage("You See it");
         return 
    true;
    }
    }
    MCPE 1.16.0
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    Then You're adding the effects incorrectly. There's plenty of examples out there!
     
  3. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    Ok i will try
     
  4. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    Thx
     
    Primus likes this.
  5. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    Umm I have problem again.
    I wan to Remove Effect But i cant to do it
     
  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.