use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class Taunt method nametagProcessor.
private void nametagProcessor(Entity entity, List<String> list) {
if (entity.hasMetadata(MetadataHandler.TAUNT_NAME)) {
return;
}
entity.setMetadata(MetadataHandler.TAUNT_NAME, new FixedMetadataValue(plugin, true));
String originalName = entity.getCustomName();
int randomizedKey = random.nextInt(list.size());
String tempName = list.get(randomizedKey);
entity.setCustomName(chatColorConverter(tempName));
new BukkitRunnable() {
@Override
public void run() {
if (!entity.isValid()) {
return;
}
if (entity.hasMetadata(MetadataHandler.CUSTOM_NAME)) {
entity.setCustomName(originalName);
} else {
entity.setCustomName(NameHandler.customAggressiveName(entity));
}
entity.removeMetadata(MetadataHandler.TAUNT_NAME, plugin);
}
}.runTaskLater(plugin, 4 * 20);
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class Taunt 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 DoubleDamage method applyPowers.
@Override
public void applyPowers(Entity entity) {
if (!(entity instanceof IronGolem)) {
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 Invisibility method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1));
MinorPowerPowerStance minorPowerPowerStance = new MinorPowerPowerStance();
minorPowerPowerStance.itemEffect(entity);
}
use of org.bukkit.metadata.FixedMetadataValue in project EliteMobs by MagmaGuy.
the class InvulnerabilityArrow method applyPowers.
@Override
public void applyPowers(Entity entity) {
entity.setMetadata(powerMetadata, new FixedMetadataValue(plugin, true));
MinorPowerPowerStance minorPowerPowerStance = new MinorPowerPowerStance();
minorPowerPowerStance.itemEffect(entity);
}
Aggregations