程序包 org.bukkit.entity

# 接口 LightningStrike

所有超级接口:
  `CommandSender`, `Entity`, `Metadatable`, `Nameable`, `Permissible`, `PersistentDataHolder`, `ServerOperator`

public interface LightningStrike extends Entity
代表雷击的实例，可能会或者不会造成伤害。

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  接口
  说明
  `static class`
  `LightningStrike.Spigot`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@Nullable Player`
  `getCausingPlayer()`
  Get the `Player` that caused this lightning to strike.
  `int`
  `getFlashes()`
  Get the amount of flashes that will occur before the lightning is removed.
  `int`
  `getLifeTicks()`
  Get the amount of ticks this lightning strike will inflict damage upon its hit entities.
  `boolean`
  `isEffect()`
  返回雷击是否是没有伤害的效果。
  `void`
  `setCausingPlayer(@Nullable Player player)`
  Set the `Player` that caused this lightning to strike.
  `void`
  `setFlashes(int flashes)`
  Set the amount of flashes that will occur before the lightning is removed.
  `void`
  `setLifeTicks(int ticks)`
  Get the amount of ticks this lightning strike will inflict damage upon its hit entities.
  `@NotNull LightningStrike.Spigot`
  `spigot()`

  ### 从接口继承的方法 org.bukkit.command.CommandSender

  `getName, sendMessage, sendMessage, sendMessage, sendMessage`

  ### 从接口继承的方法 org.bukkit.entity.Entity

  `addPassenger, 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, teleport`

  ### 从接口继承的方法 org.bukkit.metadata.Metadatable

  `getMetadata, hasMetadata, removeMetadata, setMetadata`

  ### 从接口继承的方法 org.bukkit.Nameable

  `getCustomName, setCustomName`

  ### 从接口继承的方法 org.bukkit.permissions.Permissible

  `addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment`

  ### 从接口继承的方法 org.bukkit.persistence.PersistentDataHolder

  `getPersistentDataContainer`

  ### 从接口继承的方法 org.bukkit.permissions.ServerOperator

  `isOp, setOp`

- ## 方法详细资料

  - ### isEffect

    boolean isEffect()
    返回雷击是否是没有伤害的效果。

    原文：Returns whether the strike is an effect that does no damage.

    返回:
      雷击是否为效果

  - ### getFlashes

    int getFlashes()
    Get the amount of flashes that will occur before the lightning is removed. By default this value is between 1 and 3.
    返回:
      the flashes

  - ### setFlashes

    void 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.
    参数:
      `flashes` - the flashes

  - ### getLifeTicks

    int 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.

    返回:
      the life ticks

  - ### setLifeTicks

    void 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_STRIKE` will be dispatched
    参数:
      `ticks` - the life ticks

  - ### getCausingPlayer

    @Nullable @Nullable Player getCausingPlayer()
    Get the `Player` that caused this lightning to strike. This will occur naturally if a trident enchanted with `Channeling` were thrown at an entity during a storm.
    返回:
      the player

  - ### setCausingPlayer

    void setCausingPlayer(@Nullable @Nullable Player player)
    Set the `Player` that caused this lightning to strike.
    参数:
      `player` - the player

  - ### spigot

    @NotNull @NotNull LightningStrike.Spigot spigot()
    指定者:
      `spigot` 在接口中 `CommandSender`
    指定者:
      `spigot` 在接口中 `Entity`