Package org.bukkit.entity
Interface LightningStrike
- All Superinterfaces:
net.kyori.adventure.audience.Audience,CommandSender,Entity,net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>,Metadatable,Nameable,Permissible,PersistentDataHolder,net.kyori.adventure.pointer.Pointered,ServerOperator
Represents an instance of a lightning strike. May or may not do damage.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintReturns the amount of flash iterations that will be done before the lightning dies.intReturns the amount of ticks the current flash will do damage for.booleanisEffect()Returns whether the strike is an effect that does no damage.voidsetFlashCount(int flashes)Sets the amount of life iterations that will be done before the lightning dies.voidsetLifeTicks(int lifeTicks)Sets the amount of ticks the current flash will do damage/fire for.spigot()Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound, stopSoundMethods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisualFire, teleport, teleport, teleport, teleport, teleportAsync, teleportAsyncMethods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEventMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
isEffect
boolean isEffect()Returns whether the strike is an effect that does no damage.- Returns:
- whether the strike is an effect
-
spigot
- Specified by:
spigotin interfaceCommandSender- Specified by:
spigotin interfaceEntity
-
getFlashCount
int getFlashCount()Returns the amount of flash iterations that will be done before the lightning dies.- Returns:
- amount of flashes that will be shown before the lightning dies
- See Also:
for how long the current flash will last
-
setFlashCount
void setFlashCount(int flashes)Sets the amount of life iterations that will be done before the lightning dies. Default number of flashes on creation is between 1-3.- Parameters:
flashes- amount of iterations that will be done before the lightning dies, must to be a positive number
-
getLifeTicks
int getLifeTicks()Returns the amount of ticks the current flash will do damage for. Starts with 2 by default, will damage while it is equal to or above 0, with the next flash beginning somewhere between 0 and -9.- Returns:
- ticks the current flash will do damage for
-
setLifeTicks
void setLifeTicks(int lifeTicks)Sets the amount of ticks the current flash will do damage/fire for. Default is 2 for each flash, on which the sound and effect will also be played.- Parameters:
lifeTicks- ticks the current flash will do damage for
-