Skip to content

IGatherDefensesEvent

Yeelp edited this page Feb 7, 2024 · 3 revisions

This event is fired when DDD is determining mob resistances. It can be used to give conditional resistance bonus or penalties among other things.

Importing the class

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

import mods.ddd.events.GatherDefensesEvent;

Extending IDDDClassificationEvent

This event extends IDDDClassificationEvent. So anything accessible from that event is accessible from IGatherDefensesEvent.

What can you do with this?

NOTE: All ZenMethods that alter mob resistances alter the mob resistances used in this damage calculation only. It is NOT a permanent change.

ZenMethods

float getResistance(IDDDDamageType);

  • Gets the resistance for a certain type.
    • If less than zero, this indicates a weakness to that type.
    • Zero indicates no resistance.

float setResistance(IDDDDamageType, float);

  • Sets the resistance for a certain type to the specified amount.
    • Setting to zero effectively removes a mob's resistance to the specified type.
    • Setting to a value less than zero gives the mob a weakness to that type.

boolean hasResistance(IDDDDamageType);

  • Checks if this mob has a resistance to this type.
    • A resistance value above zero indicates a resistance.

boolean hasWeakness(IDDDDamageType);

  • Checks if this mob has a weakness to this type.
    • A resistance value below zero indicates a weakness.

boolean hasImmunity(IDDDDamageType);

  • Checks if a mob is immune to this type.
    • true indicates the mob is immune to this type.

void grantImmunity(IDDDDamageType);

  • Grants the mob immunity to this damage type.
    • Nothing happens if this mob is already immune to this type.

void revokeImmunity(IDDDDamageType);

  • Removes a mob's immunity to this damage type.
    • Nothing happens if this mob wasn't immune to this type already.

void clearImmunities();

  • Clears all of a mob's immunities.
    • Nothing happens if this mob had no immunities to begin with.

void clearResistancesAndWeaknesses();

  • Clears all of a mob's resistances and weaknesses.
    • Nothing happens if this mob has no resistances or weaknesses.
Clone this wiki locally