Class PlayerHitConstructionEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerConstructionEvent
net.risingworld.api.events.player.world.PlayerHitConstructionEvent
- All Implemented Interfaces:
Cancellable
Called when a player hits a construction element (e.g planks, beams, posters etc).
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the construction element.short
Gets the amount of damage the player causes by hitting the construction element.Gets the world coordinates where the construction element was hit exactly.void
setDamage
(short damage) Sets the amount of damage the player should inflict with this hit.Methods inherited from class net.risingworld.api.events.player.world.PlayerConstructionEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getConstructionDefinition, getGlobalID, getTexture, getTypeID, isCancelled, setCancelled
Methods inherited from class net.risingworld.api.events.player.PlayerEvent
getPlayer
-
Method Details
-
getDamage
public short getDamage()Gets the amount of damage the player causes by hitting the construction element.- Returns:
- the amount of damage dealt with this hit.
-
setDamage
public void setDamage(short damage) Sets the amount of damage the player should inflict with this hit.- Parameters:
damage
- the new amount of damage.
-
getHitPosition
Gets the world coordinates where the construction element was hit exactly.- Returns:
- coordinates where the construction element was hit.
-
getConstructionElement
Description copied from class:PlayerConstructionEvent
Gets the construction element.- Overrides:
getConstructionElement
in classPlayerConstructionEvent
- Returns:
- the construction element.
-