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

How to change arrow(s) damage

Comments in 'Plugin Development' started by TryoneLegendZzz, Aug 9, 2015.

  1. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    Ok so i want too know how do u change a/an arrow(s) damage?
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    entitydamageevent and check the cause. If it is a arrow then setcancelled then give the hurter damage your self.
    Samueljh1H8sLag likes this.
  3. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    so
    Code:
    if($cause === EntityDamageByArrowEvent)?
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    No.
    PHP:
    public function onHitByArrow(EntityDamageEvent $event){
        if(
    $event->getCause() === 2){
            
    $event->setCancelled(true);
            
    $event->getEntity()->attack(WHAT EVER HERE);
        }
    }
    TryoneLegendZzz likes this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    If($event instanceof EntityDamageByChildEntityEvent and $event->getChild() instanceof Arrow) {
      
    $event->setDamage($new_damage);
    }
  6. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    i did something like this and it worked :p

Share This Page

Advertisement