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
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.
-
getPlant
Description copied from class:PlayerVegetationEvent
Gets the plant.- Overrides:
getPlant
in classPlayerVegetationEvent
- Returns:
- the plant element.
-