use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class AttackFreeze method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
MinorPowerPowerStance minorPowerPowerStance = new MinorPowerPowerStance();
minorPowerPowerStance.itemEffect(entity);
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class AttackGravity method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
MinorPowerPowerStance minorPowerPowerStance = new MinorPowerPowerStance();
minorPowerPowerStance.itemEffect(entity);
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class AttackFire method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
MinorPowerPowerStance minorPowerPowerStance = new MinorPowerPowerStance();
minorPowerPowerStance.itemEffect(entity);
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class AttackFireball method attackFireball.
@EventHandler
public void attackFireball(EntityTargetEvent event) {
if (event.getEntity().hasMetadata(powerMetadata) && !event.getEntity().hasMetadata(MetadataHandler.SHOOTING_FIREBALLS)) {
Entity targetter = event.getEntity();
Entity targetted = event.getTarget();
if (targetted instanceof Player) {
targetter.setMetadata(MetadataHandler.SHOOTING_FIREBALLS, new FixedMetadataValue(plugin, true));
new BukkitRunnable() {
@Override
public void run() {
if (!targetted.isValid() || !targetter.isValid() || targetted.getWorld() != targetter.getWorld() || targetted.getLocation().distance(targetter.getLocation()) > 20) {
targetter.removeMetadata(MetadataHandler.SHOOTING_FIREBALLS, plugin);
cancel();
return;
}
Entity repeatingFireball = targetter.getWorld().spawnEntity(targetter.getLocation().add(0, 3, 0), EntityType.FIREBALL);
Vector targetterToTargetted = targetted.getLocation().toVector().subtract(repeatingFireball.getLocation().toVector());
double distanceNerfRepeating = (targetted.getLocation().distance(targetter.getLocation())) / 100;
repeatingFireball.setVelocity(targetterToTargetted.multiply(0.5 - distanceNerfRepeating).multiply(0.1));
}
}.runTaskTimer(plugin, 0, 20 * 8);
}
}
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class ZombieTeamRocket method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
MajorPowerPowerStance majorPowerStanceMath = new MajorPowerPowerStance();
majorPowerStanceMath.itemEffect(entity);
}
Aggregations