Package org.bukkit.entity
Interface LightningStrike
- All Superinterfaces:
- CommandSender,- Entity,- Metadatable,- Nameable,- Permissible,- PersistentDataHolder,- ServerOperator
Represents an instance of a lightning strike. May or may not do damage.
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionGet thePlayerthat caused this lightning to strike.intGet the amount of flashes that will occur before the lightning is removed.intGet the amount of ticks this lightning strike will inflict damage upon its hit entities.booleanisEffect()Returns whether the strike is an effect that does no damage.voidsetCausingPlayer(Player player) Set thePlayerthat caused this lightning to strike.voidsetFlashes(int flashes) Set the amount of flashes that will occur before the lightning is removed.voidsetLifeTicks(int ticks) Get the amount of ticks this lightning strike will inflict damage upon its hit entities.spigot()Methods inherited from interface org.bukkit.command.CommandSendergetName, sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from interface org.bukkit.entity.EntityaddPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, teleport, teleport, teleport, teleportMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablegetCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
isEffectboolean isEffect()Returns whether the strike is an effect that does no damage.- Returns:
- whether the strike is an effect
 
- 
getFlashesint getFlashes()Get the amount of flashes that will occur before the lightning is removed. By default this value is between 1 and 3.- Returns:
- the flashes
 
- 
setFlashesvoid setFlashes(int flashes) Set the amount of flashes that will occur before the lightning is removed. One flash will occur after this lightning strike's life has reduced below 0.- Parameters:
- flashes- the flashes
 
- 
getLifeTicksint getLifeTicks()Get the amount of ticks this lightning strike will inflict damage upon its hit entities.When life ticks are negative, there is a random chance that another flash will be initiated and life ticks reset to 1. - Returns:
- the life ticks
 
- 
setLifeTicksvoid setLifeTicks(int ticks) Get the amount of ticks this lightning strike will inflict damage upon its hit entities.When life ticks are negative, there is a random chance that another flash will be initiated and life ticks reset to 1. Additionally, if life ticks are set to 2 (the default value when a lightning strike has been spawned), a list of events will occur: - Impact sound effects will be played
- Fire will be spawned (dependent on difficulty)
- Lightning rods will be powered (if hit)
- Copper will be stripped (if hit)
- GameEvent.LIGHTNING_STRIKEwill be dispatched
 - Parameters:
- ticks- the life ticks
 
- 
getCausingPlayerGet thePlayerthat caused this lightning to strike. This will occur naturally if a trident enchanted withChannelingwere thrown at an entity during a storm.- Returns:
- the player
 
- 
setCausingPlayerSet thePlayerthat caused this lightning to strike.- Parameters:
- player- the player
 
- 
spigot- Specified by:
- spigotin interface- CommandSender
- Specified by:
- spigotin interface- Entity
 
 
-