Package net.risingworld.api.events.world
Klasse ExplosionEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.world.ExplosionEvent
- Alle implementierten Schnittstellen:
Cancellable
Called when an explosion is triggered (e.g caused by tnt).
Example: Prevent explosion from causing any damage (but it's still visible) Example: Suppress explosion, so it neither causes damage nor is visible at all
-
Feldübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungshort
Sets the amount of damage this explosion deals for npcs (e.g animals).short
Gets the amount of damage this explosion deals for players.Gets the global world position of the explosion.Gets the related item which caused this explosion (e.g tnt).Gets the player who is responsible for this explosion.short
Sets the amount of damage this explosion deals for world structures (i.e buildings), objects and vegetations.boolean
Determines if the event is cancelled.boolean
Gets whether or not other explosives will be triggered by this explosion.void
setCancelled
(boolean cancel) Cancels this event.void
setNpcDamage
(short damage) Sets the amount of damage this explosion deals for npcs (e.g animals).void
setPlayerDamage
(short damage) Sets the amount of damage this explosion deals for players.void
setPosition
(float x, float y, float z) Changes the global world position of the explosion.void
setPosition
(Vector3f position) Changes the global world position of the explosion.void
setTriggerExplosives
(boolean set) Sets whether or not this explosion should trigger other explosives.void
setWorldDamage
(short damage) Sets the amount of damage this explosion deals for world structures (i.e buildings), objects and vegetations.
-
Methodendetails
-
getPosition
Gets the global world position of the explosion.- Gibt zurück:
- the global position, as a Vector3f
-
setPosition
Changes the global world position of the explosion.- Parameter:
position
- the new position.
-
setPosition
public void setPosition(float x, float y, float z) Changes the global world position of the explosion.- Parameter:
x
- the new x position.y
- the new y position.z
- the new z position.
-
getRelatedItem
Gets the related item which caused this explosion (e.g tnt). If this explosion wasn't caused by an item, this function returns null.- Gibt zurück:
- the item which caused this explosion, or null if there is no related item.
-
setPlayerDamage
public void setPlayerDamage(short damage) Sets the amount of damage this explosion deals for players. Set to 0 to prevent this explosion from harming players.- Parameter:
damage
- the amount of damage (players).
-
getPlayerDamage
public short getPlayerDamage()Gets the amount of damage this explosion deals for players.- Gibt zurück:
- the amount of damage (players).
-
setNpcDamage
public void setNpcDamage(short damage) Sets the amount of damage this explosion deals for npcs (e.g animals). Set to 0 to prevent this explosion from harming npcs.- Parameter:
damage
- the amount of damage (npcs).
-
getNpcDamage
public short getNpcDamage()Sets the amount of damage this explosion deals for npcs (e.g animals).- Gibt zurück:
- the amount of damage (npcs).
-
setWorldDamage
public void setWorldDamage(short damage) Sets the amount of damage this explosion deals for world structures (i.e buildings), objects and vegetations. Set to 0 to prevent this explosion from causing any damage to the world.- Parameter:
damage
- the amount of damage (world).
-
getWorldDamage
public short getWorldDamage()Sets the amount of damage this explosion deals for world structures (i.e buildings), objects and vegetations.- Gibt zurück:
- the amount of damage (world).
-
setTriggerExplosives
public void setTriggerExplosives(boolean set) Sets whether or not this explosion should trigger other explosives.- Parameter:
set
- true to trigger other explosives which are in proximity, false to prevent this behaviour.
-
isTriggerExplosivesEnabled
public boolean isTriggerExplosivesEnabled()Gets whether or not other explosives will be triggered by this explosion.- Gibt zurück:
- true if other explosives in proximity get triggered by this explosion, false if not.
-
getRelatedPlayer
Gets the player who is responsible for this explosion. Returns null if this explosion is not caused by a player.- Gibt zurück:
- the player who triggered this explosion, or null if this explosion wasn't caused by a player.
-
isCancelled
public boolean isCancelled()Beschreibung aus Schnittstelle kopiert:Cancellable
Determines if the event is cancelled. If an event is cancelled, it will no longer be executed, but other plugins will still receive the event.
Please note: If the event is threaded, cancellation has no effect, i.e the event will still be executed.- Angegeben von:
isCancelled
in SchnittstelleCancellable
- Gibt zurück:
- true if the event is cancelled, or false if not.
-
setCancelled
public void setCancelled(boolean cancel) Beschreibung aus Schnittstelle kopiert:Cancellable
Cancels this event. This means it will no longer be executed, but other plugins will still receive the event.- Angegeben von:
setCancelled
in SchnittstelleCancellable
- Parameter:
cancel
- set to true if you want to cancel this event.- Example: Cancel "PlayerEnterAreaEvent", i.e prevent player from entering an area
-