use of org.bukkit.potion.PotionEffect in project EliteMobs by MagmaGuy.
the class AttackGravity method attackGravity.
@EventHandler
public void attackGravity(EntityDamageByEntityEvent event) {
Entity damager = event.getDamager();
Entity damagee = event.getEntity();
if (damager.hasMetadata(powerMetadata) && damagee instanceof LivingEntity) {
((LivingEntity) damagee).addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 2 * 20, 1));
}
if (damager instanceof Projectile) {
if (ProjectileMetadataDetector.projectileMetadataDetector(((Projectile) damager), powerMetadata)) {
((LivingEntity) damagee).addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 2 * 20, 1));
}
}
}
use of org.bukkit.potion.PotionEffect in project EliteMobs by MagmaGuy.
the class AttackConfusing method attackConfusing.
@EventHandler
public void attackConfusing(EntityDamageByEntityEvent event) {
Entity damager = event.getDamager();
Entity damagee = event.getEntity();
if (damager.hasMetadata(powerMetadata)) {
if (damagee instanceof Player) {
Player player = (Player) damagee;
player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 3));
}
} else if (damager instanceof Projectile && damagee instanceof Player) {
if (ProjectileMetadataDetector.projectileMetadataDetector((Projectile) damager, powerMetadata)) {
Player player = (Player) damagee;
player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 3));
}
}
}
use of org.bukkit.potion.PotionEffect in project Glowstone by GlowstoneMC.
the class GlowMetaPotion method fromNBT.
public static PotionEffect fromNBT(CompoundTag tag) {
PotionEffectType type = PotionEffectType.getById(tag.getByte("Id"));
int duration = tag.getInt("Duration");
int amplifier = tag.getByte("Amplifier");
boolean ambient = tag.isByte("Ambient") && tag.getBool("Ambient");
boolean particles = !tag.isByte("ShowParticles") || tag.getBool("ShowParticles");
return new PotionEffect(type, duration, amplifier, ambient, particles);
}
use of org.bukkit.potion.PotionEffect in project Glowstone by GlowstoneMC.
the class GlowBeacon method setPrimaryEffect.
@Override
public void setPrimaryEffect(PotionEffectType primary) {
this.primaryEffect = new PotionEffect(primary, 7, getTier(), true);
getBlockEntity().setPrimaryId(primary.getId());
}
use of org.bukkit.potion.PotionEffect in project MyMaid2 by jaoafa.
the class Event_Antijaoium method isjaoium.
/**
* jaoiumと判定されるアイテムかどうか
* @param list PotionEffectのList
* @return jaoiumかどうか
* @author mine_book000
*/
private boolean isjaoium(List<PotionEffect> list) {
HEAL_jaoium.add(-3);
HEAL_jaoium.add(29);
HEAL_jaoium.add(125);
HEAL_jaoium.add(253);
HEALTH_BOOST_jaoium.add(-7);
Boolean jaoium = false;
for (PotionEffect po : list) {
if (po.getType().equals(PotionEffectType.HEAL)) {
if (HEAL_jaoium.contains(po.getAmplifier())) {
// アウト
jaoium = true;
}
}
if (po.getType().equals(PotionEffectType.HEALTH_BOOST)) {
if (HEALTH_BOOST_jaoium.contains(po.getAmplifier())) {
// アウト
jaoium = true;
}
}
}
return jaoium;
}
Aggregations