Class LightningStrikeEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.world.LightningStrikeEvent
- All Implemented Interfaces:
Cancellable
Called when a lightning strikes a target.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionshortGets the amount of damage this lightning deals.Gets the global world position of the lightning strike.Gets the target that was struck by this lightning.boolean/////////////////////////////////////////////////////////////////////////voidsetCancelled(boolean cancel) Cancels this event.voidsetDamage(short damage) Sets the amount of damage this lightning deals.
-
Method Details
-
getPosition
Gets the global world position of the lightning strike.- Returns:
- the global position, as a Vector3f
-
getTarget
Gets the target that was struck by this lightning. Typically this is either of typePlayerorNpc.- Returns:
- the target that was struck by this lightning.
- Example: Check if player was struck
-
setDamage
public void setDamage(short damage) Sets the amount of damage this lightning deals. Set to 0 to prevent this lightning from harming players or npcs.- Parameters:
damage- the amount of damage.
-
getDamage
public short getDamage()Gets the amount of damage this lightning deals.- Returns:
- the amount of damage.
-
isCancelled
public boolean isCancelled()/////////////////////////////////////////////////////////////////////////- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if the event is cancelled, or false if not.
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableCancels this event. This means it will no longer be executed, but other plugins will still receive the event.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- set to true if you want to cancel this event.- Example: Cancel "PlayerEnterAreaEvent", i.e prevent player from entering an area
-