Package net.minecraft.entity.effect
Class StatusEffect
java.lang.Object
net.minecraft.entity.effect.StatusEffect
- Direct Known Subclasses:
AbsorptionStatusEffect
,DamageModifierStatusEffect
,HealthBoostStatusEffect
,InstantStatusEffect
public class StatusEffect extends Object
-
Field Summary
Fields Modifier and Type Field Description private Map<EntityAttribute,EntityAttributeModifier>
attributeModifiers
private int
color
private String
translationKey
private StatusEffectType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
StatusEffect(StatusEffectType type, int color)
-
Method Summary
Modifier and Type Method Description StatusEffect
addAttributeModifier(EntityAttribute attribute, String uuid, double amount, EntityAttributeModifier.Operation operation)
double
adjustModifierAmount(int amplifier, EntityAttributeModifier modifier)
void
applyInstantEffect(Entity source, Entity attacker, LivingEntity target, int amplifier, double proximity)
void
applyUpdateEffect(LivingEntity entity, int amplifier)
static StatusEffect
byRawId(int rawId)
boolean
canApplyUpdateEffect(int duration, int amplifier)
Map<EntityAttribute,EntityAttributeModifier>
getAttributeModifiers()
int
getColor()
Text
getName()
static int
getRawId(StatusEffect type)
String
getTranslationKey()
StatusEffectType
getType()
boolean
isBeneficial()
boolean
isInstant()
protected String
loadTranslationKey()
void
onApplied(LivingEntity entity, AttributeContainer attributes, int amplifier)
void
onRemoved(LivingEntity entity, AttributeContainer attributes, int amplifier)
-
Field Details
-
attributeModifiers
-
type
-
color
private final int color -
translationKey
-
-
Constructor Details
-
StatusEffect
-
-
Method Details
-
byRawId
-
getRawId
-
applyUpdateEffect
-
applyInstantEffect
public void applyInstantEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) -
canApplyUpdateEffect
public boolean canApplyUpdateEffect(int duration, int amplifier) -
isInstant
public boolean isInstant() -
loadTranslationKey
-
getTranslationKey
-
getName
-
getType
-
getColor
public int getColor() -
addAttributeModifier
public StatusEffect addAttributeModifier(EntityAttribute attribute, String uuid, double amount, EntityAttributeModifier.Operation operation) -
getAttributeModifiers
-
onRemoved
-
onApplied
-
adjustModifierAmount
-
isBeneficial
@Environment(CLIENT) public boolean isBeneficial()
-