Class DamageScope
java.lang.Object
studio.magemonkey.codex.api.damage.DamageScope
- All Implemented Interfaces:
AutoCloseable
An open
DamageRequest for one target, from DamageContexts.open(Entity, DamageRequest). Closing it withdraws the
request. Always use it in a try-with-resources statement, so that it is closed even when the damage
event is cancelled or something throws.-
Method Details
-
isClaimed
public boolean isClaimed()Whether a damage event picked the request up. If it is still false after the call todamage(), nothing read the request and the hit was handled as ordinary damage. -
close
public void close()Withdraws the request. Closing a scope twice does nothing.- Specified by:
closein interfaceAutoCloseable
-
getRequest
-
isClosed
public boolean isClosed()
-