Class PlayerHitObjectEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerObjectEvent
net.risingworld.api.events.player.world.PlayerHitObjectEvent
- All Implemented Interfaces:
Cancellable
Called when a player hits an object (e.g furniture, doors, lamps etc).
Example: Destroy object after a single hit
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionshortGets the amount of damage the player causes by hitting the object.Gets the world coordinates where the object was hit exactly.Gets the object element.voidsetDamage(short damage) Sets the amount of damage the player should inflict with this hit.Methods inherited from class net.risingworld.api.events.player.world.PlayerObjectEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getGlobalID, getObjectDefinition, getTypeID, isCancelled, setCancelledMethods 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 object.- 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 object was hit exactly.- Returns:
- coordinates where the object was hit.
-
getObject
Description copied from class:PlayerObjectEventGets the object element.- Overrides:
getObjectin classPlayerObjectEvent- Returns:
- the object element.
-