IUpdateAdaptiveResistanceEvent - yeelp/Distinct-Damage-Descriptions GitHub Wiki

This event is fired at the end of damage calculations. At this point, all damage has been dealt. This event is to determine if the defending entity should update its adaptive resistance. This event is fired even if the mob has no adaptive resistance; that way you can define situations where you want a mob to adapt to the damage even when it wouldn't normally.

Importing the class

It might be required to import the class to avoid errors.

import mods.ddd.events.UpdateAdaptiveResistanceEvent;

Extending IDDDCalculationEvent

This event extends IDDDCalculationEvent. So anything accessible from that event is accessible from IUpdateAdaptiveResistancesEvent.

What can you do with this?

ZenGetters

ZenGetter Return Type Notes
adaptiveAmount float Gets the adaptive amount this entity is using in this calculation.

ZenSetters

ZenSetter Parameter Type Notes
adaptiveAmount float Sets the adaptive amount this entity will use in this calculation only.

ZenMethods

float getResistance(IDDDDamageType);

  • Gets the resistance this mob has to this type.

boolean hasImmunity(IDDDDamageType);

  • Returns true if the mob is immune to this type.

void ignoreType(IDDDDamageType);

  • Prevent this mob from adapting to this type.

void denyResult();

  • Prevent this entity from adapting at all for this calculation.

void defaultResult();

  • Let the mob adapt if it has adaptability, otherwise it will not adapt. This is the default result.

void forceResult();

  • Force this mob to adapt as if it had adaptability, even if it doesn't. This is only for this calculation only. A mob that is not adaptive and is forced to adapt in this manner will keep their adaptive resistances until they are forced to update again via this ZenMethod.