Class LightningBolt

All Implemented Interfaces:
CommandSource, SyncedDataHolder, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, INBTSerializable<CompoundTag>

public class LightningBolt extends Entity
  • Field Details

    • START_LIFE

      private static final int START_LIFE
      See Also:
    • DAMAGE_RADIUS

      private static final double DAMAGE_RADIUS
      See Also:
    • DETECTION_RADIUS

      private static final double DETECTION_RADIUS
      See Also:
    • life

      private int life
    • seed

      public long seed
    • flashes

      private int flashes
    • visualOnly

      private boolean visualOnly
    • cause

      @Nullable private ServerPlayer cause
    • hitEntities

      private final Set<Entity> hitEntities
    • blocksSetOnFire

      private int blocksSetOnFire
    • damage

      private float damage
  • Constructor Details

  • Method Details

    • setVisualOnly

      public void setVisualOnly(boolean p_20875_)
    • getSoundSource

      public SoundSource getSoundSource()
      Overrides:
      getSoundSource in class Entity
    • getCause

      @Nullable public ServerPlayer getCause()
    • setCause

      public void setCause(@Nullable ServerPlayer p_20880_)
    • powerLightningRod

      private void powerLightningRod()
    • setDamage

      public void setDamage(float damage)
    • getDamage

      public float getDamage()
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • getStrikePosition

      private BlockPos getStrikePosition()
    • spawnFire

      private void spawnFire(int p_20871_)
    • clearCopperOnLightningStrike

      private static void clearCopperOnLightningStrike(Level p_147151_, BlockPos p_147152_)
    • randomWalkCleaningCopper

      private static void randomWalkCleaningCopper(Level p_147146_, BlockPos p_147147_, BlockPos.MutableBlockPos p_147148_, int p_147149_)
    • randomStepCleaningCopper

      private static Optional<BlockPos> randomStepCleaningCopper(Level p_147154_, BlockPos p_147155_)
    • shouldRenderAtSqrDistance

      public boolean shouldRenderAtSqrDistance(double p_20869_)
      Overrides:
      shouldRenderAtSqrDistance in class Entity
    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder p_325966_)
      Specified by:
      defineSynchedData in class Entity
    • readAdditionalSaveData

      protected void readAdditionalSaveData(CompoundTag p_20873_)
      Specified by:
      readAdditionalSaveData in class Entity
    • addAdditionalSaveData

      protected void addAdditionalSaveData(CompoundTag p_20877_)
      Specified by:
      addAdditionalSaveData in class Entity
    • getBlocksSetOnFire

      public int getBlocksSetOnFire()
    • getHitEntities

      public Stream<Entity> getHitEntities()