Class PlayerHitVegetationEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerVegetationEvent
net.risingworld.api.events.player.world.PlayerHitVegetationEvent
- All Implemented Interfaces:
Cancellable
Called when a player hits a plant (e.g a tree, bush, flowers etc).
Example: Randomly spawn an apple when player hits a tree
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionshort
Gets the amount of damage the player inflicts by hitting the plant.Gets the world coordinates where the plant 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.PlayerVegetationEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getGlobalID, getPlantDefinition, 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 inflicts by hitting the plant.- 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 plant was hit exactly.- Returns:
- coordinates where the plant was hit.
-