PotionFluxTaint
Package: thaumcraft.api.potions
A dangerous potion effect representing flux contamination from unstable vis processing. It is the primary harmful effect of Taint flux. Unlike PotionVisExhaust, this potion has an active performEffect that deals damage to most living entities.
Class Declaration
public class PotionFluxTaint extends Potion
Static Instance
public static PotionFluxTaint instance = null
The instance is null at load time and is initialized at runtime via PotionFluxTaint.init(). It cannot be used before registration.
Initialization
public static void init()
Called by Thaumcraft during potion registration. Sets:
- Potion name:
"potion.fluxtaint" - Icon index:
(3, 1)on the potion spritesheet - Effectiveness:
0.25D
Behavior
performEffect
public void performEffect(EntityLivingBase target, int par2)
Applies different effects depending on the target:
| Condition | Effect |
|---|---|
Target implements ITaintedMob |
Heals the entity by 1 HP |
| Target is not undead and not a player | Attacks for 1 damage via DamageSourceThaumcraft.taint |
Target is not undead, and has maxHealth > 1 or is a player |
Attacks for 1 damage via DamageSourceThaumcraft.taint |
isReady
public boolean isReady(int par1, int par2)
Returns true every tick when amplifier modifier is 0. When the amplifier is higher, the effect triggers every 40 >> amplifier ticks (i.e., less frequently at higher levels).
int k = 40 >> par2;
return k > 0 ? par1 % k == 0 : true;
isBadEffect
Returns true — this is classified as a harmful effect.
Damage Source
Uses DamageSourceThaumcraft.taint for damage. This damage source is specifically associated with Taint flux damage.
Related Interfaces
ITaintedMob
An entity implementing ITaintedMob is healed by this potion instead of being damaged. Thaumcraft’s Taint creatures implement this interface. Mods can apply it to their own mob classes:
public interface ITaintedMob {
// Marker interface — no methods required
}
Usage
if (player.isPotionActive(PotionFluxTaint.instance)) {
// Player is suffering from flux taint
PotionEffect effect = player.getActivePotionEffect(PotionFluxTaint.instance);
int amplifier = effect.getAmplifier(); // 0-based
}
Related
PotionVisExhaust— another flux-related potion (passive vis drain)DamageSourceThaumcraft.taint— the damage source usedITaintedMob— marker for Taint-immune/healing mobs