IShieldBlockEvent - yeelp/Distinct-Damage-Descriptions GitHub Wiki

This is the event DDD fires when it detects a shield is being used to block damage. You can use this event to prevent the shield from being effective, or you can implement conditional shield bonuses.

Importing the class

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

import mods.ddd.events.ShieldBlockEvent;

Extending IDDDClassificationEvent

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

Canceling the Event

This event can be canceled. Cancelling this event causes DDD to skip shield calculations entirely. Resources like durability will not be consumed from the shield.

What can you do with this?

ZenGetters

ZenGetter Return Type Notes
shield IItemStack Gets the shield being used in this calculation.

ZenMethods

float getEffectiveness(IDDDDamageType);

  • Gets the effectiveness rating for this shield's Shield Distribution.
    • Is zero if the shield is not effective at all against that type.

void setEffectiveness(IDDDDamageType, float);

  • Sets the effectiveness rating for this shield's Shield Distribution.
    • This is for this damage calculation only.