Java Code Examples for org.bukkit.potion.PotionEffectType#WITHER
The following examples show how to use
org.bukkit.potion.PotionEffectType#WITHER .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Withered.java From MineTinker with GNU General Public License v3.0 | 6 votes |
public PotionEffect getPotionEffect(@Nullable Event event, @Nullable Entity entity, @NotNull Player player, @NotNull ItemStack tool) { int level = modManager.getModLevel(tool, this); int duration = (int) (this.duration * Math.pow(this.durationMultiplier, (level - 1))); int amplifier = this.effectAmplifier * (level - 1); if (entity == null) { ChatWriter.logModifier(player, event, this, tool, "Duration(" + duration + ")", "Amplifier(" + amplifier + ")"); } else { ChatWriter.logModifier(player, event, this, tool, "Duration(" + duration + ")", "Amplifier(" + amplifier + ")", "Entity(" + entity.getType().toString() + ")"); } return new PotionEffect(PotionEffectType.WITHER, duration, amplifier, false, false); }
Example 2
Source File: PotionDamageResolver.java From ProjectAres with GNU Affero General Public License v3.0 | 6 votes |
@Override public @Nullable PotionInfo resolveDamage(EntityDamageEvent.DamageCause damageType, Entity victim, @Nullable PhysicalInfo damager) { // If potion is already resolved (i.e. as a splash potion), leave it alone if(damager instanceof PotionInfo || damager instanceof ProjectileInfo && ((ProjectileInfo) damager).getProjectile() instanceof PotionInfo) { return null; } final PotionEffectType effect; switch(damageType) { case POISON: effect = PotionEffectType.POISON; break; case WITHER: effect = PotionEffectType.WITHER; break; case MAGIC: effect = PotionEffectType.HARM; break; default: return null; } return new GenericPotionInfo(effect); }
Example 3
Source File: PotionDamageResolver.java From PGM with GNU Affero General Public License v3.0 | 5 votes |
@Override public @Nullable PotionInfo resolveDamage( EntityDamageEvent.DamageCause damageType, Entity victim, @Nullable PhysicalInfo damager) { PotionEffectType effect; switch (damageType) { case POISON: effect = PotionEffectType.POISON; break; case WITHER: effect = PotionEffectType.WITHER; break; case MAGIC: effect = null; break; default: return null; } // If potion is already resolved (i.e. as a splash potion), leave it alone if (damager instanceof PotionInfo || damager instanceof ProjectileInfo && ((ProjectileInfo) damager).getProjectile() instanceof PotionInfo) { return null; } return new GenericPotionInfo(effect); }