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

Solved Problem with EntityDamage..

Comments in 'Plugin Development' started by Ritch, May 3, 2016.

  1. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Hi guys, the problem is that while the world works but I want a world one and not the all.
    #SorryForMyBadEnglish
    PHP:
        public function onDamage(EntityDamageEvent $event){
          
    $player $event->getEntity();
         if(
    $player->getLevel()->getName() === "world"){
         if(
    $player instanceof Player && $event->getCause() === EntityDamageEvent::CAUSE_PROJECTILE){
               
    $event->setDamage(2);
               
    $event->setKnockBack($event->getKnockBack() * 2);
               
    $sound = new LaunchSound($player);
               
    $player->getLevel()->addSound($sound);  
               }
            }
        }
  2. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    I don't even know what you mean and what is the problem with your code..
    What does "a world one and not the all" means ?
    Primus and HotFireyDeath like this.
  3. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Solved... Please stop message

Share This Page

Advertisement