Skip to content
Permalink
Browse files

Equip a spectral arrow to make targets glow!

  • Loading branch information...
mcmonkey4eva committed Mar 27, 2016
1 parent 1cdb5a6 commit eb777047b2874e23c026bcb1287cc754ed01a40e
Showing with 21 additions and 0 deletions.
  1. +2 −0 README.md
  2. +19 −0 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
@@ -35,6 +35,8 @@ Created by mcmonkey4eva on behalf of the Citizens and Denizen teams.
- Blaze rod (shoots fire balls!)
- Potions (splash, lingering)
- Nether star (strikes lightning!)
- Spectral arrow (makes the target glow, without damaging it.)
- (To make a target glow ++ damage it, equip a bow + arm it with spectral arrows!)

### TODO

@@ -271,6 +271,21 @@ else if (rangedChase) {
chase(entity);
}
}
else if (usesSpectral()) {
if (canSee(entity)) {
if (timeSinceAttack < attackRate) {
return;
}
timeSinceAttack = 0;
// TODO: Consume ammo if needed!
swingWeapon();
// TODO: Audio?
entity.setGlowing(true);
}
else if (rangedChase) {
chase(entity);
}
}
else {
double distsq = entity.getLocation().distanceSquared(getLivingEntity().getLocation());
if (distsq < 3 * 3) {
@@ -312,6 +327,10 @@ public boolean usesLightning() {
return getLivingEntity().getEquipment().getItemInMainHand().getType() == Material.NETHER_STAR;
}

public boolean usesSpectral() {
return getLivingEntity().getEquipment().getItemInMainHand().getType() == Material.SPECTRAL_ARROW;
}

public boolean usesPotion() {
Material type = getLivingEntity().getEquipment().getItemInMainHand().getType();
return type == Material.SPLASH_POTION || type == Material.LINGERING_POTION;

0 comments on commit eb77704

Please sign in to comment.
You can’t perform that action at this time.