Class LightningEntity
- All Implemented Interfaces:
DataTracked
,ScoreHolder
,Nameable
,EntityLike
- Mappings:
Namespace Name named net/minecraft/entity/LightningEntity
intermediary net/minecraft/class_1538
official bwe
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReason
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private int
private @Nullable ServerPlayerEntity
private boolean
private static final int
private static final double
private static final double
private int
long
Fields inherited from class net.minecraft.entity.Entity
age, collidedSoftly, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, fallDistance, field_44870, field_44871, field_44872, field_49073, field_49791, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLIDING_FLAG_INDEX, GLOWING_FLAG_INDEX, groundCollision, horizontalCollision, ID_KEY, inPowderSnow, intersectionChecked, lastRenderX, lastRenderY, lastRenderZ, MAX_COMMAND_TAGS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, movementMultiplier, noClip, ON_FIRE_FLAG_INDEX, PASSENGERS_KEY, portalManager, POSE, prevPitch, prevX, prevY, prevYaw, prevZ, random, ridingCooldown, speed, submergedInWater, supportingBlockPos, timeUntilRegen, touchingWater, uuid, UUID_KEY, uuidString, velocityDirty, velocityModified, verticalCollision, wasInPowderSnow
Fields inherited from interface net.minecraft.scoreboard.ScoreHolder
WILDCARD, WILDCARD_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
cleanOxidation
(World world, BlockPos pos) cleanOxidationAround
(World world, BlockPos pos) private static void
cleanOxidationAround
(World world, BlockPos pos, BlockPos.Mutable mutablePos, int count) final boolean
damage
(ServerWorld world, DamageSource source, float amount) Applies a damage to this entity.private BlockPos
int
Returns the sound category for sounds from this entity.protected void
initDataTracker
(DataTracker.Builder builder) Initializes data tracker.private void
protected void
Reads custom data fromnbt
.void
setChanneler
(@Nullable ServerPlayerEntity channeler) void
setCosmetic
(boolean cosmetic) boolean
shouldRender
(double distance) private void
spawnFire
(int spreadAttempts) void
tick()
Ticks this entity.protected void
Writes custom data tonbt
.Methods inherited from class net.minecraft.entity.Entity
addAirTravelEffects, addCommandTag, addFlapEffects, addPassenger, addPortalChunkTicketAt, addVelocity, addVelocity, addVelocityInternal, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, animateDamage, applyGravity, applyMirror, applyRotation, attemptTickInVoid, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundingBox, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canHit, canModifyAt, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canTeleportBetween, canUsePortals, changeLookDirection, checkDespawn, checkWaterState, clientDamage, collidesWith, collidesWithStateAtPos, copyFrom, copyPositionAndRotation, couldAcceptPassenger, createSpawnPacket, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, emitGameEvent, entityDataRequiresOperator, equals, extinguish, extinguishWithSound, fall, getAir, getAttachments, getBlockPos, getBlockStateAtPos, getBlockX, getBlockY, getBlockZ, getBodyY, getBodyYaw, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getChunkPos, getClientCameraPosVec, getCommandSource, getCommandTags, getControllingPassenger, getControllingVehicle, getCustomName, getDamageSources, getDataTracker, getDefaultName, getDefaultPortalCooldown, getDimensions, getDisplayName, getEffectiveExplosionResistance, getEntityWorld, getEyeHeight, getEyePos, getEyeY, getFacing, getFinalGravity, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getGravity, getHandPosOffset, getHeadYaw, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getId, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastRenderPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPitch, getLerpedPos, getLerpedYaw, getLerpTargetPitch, getLerpTargetX, getLerpTargetY, getLerpTargetYaw, getLerpTargetZ, getLootTableKey, getMaxAir, getMinFreezeDamageTicks, getMoveEffect, getMovement, getMovementDirection, getName, getNameForScoreboard, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerAttachmentPos, getPassengerAttachmentPos, getPassengerDismountOffset, getPassengerList, getPassengerRidingPos, getPassengersDeep, getPickBlockStack, getPistonBehavior, getPitch, getPitch, getPlayerPassengers, getPortalCooldown, getPos, getPose, getPosWithYOffset, getProjectileDeflection, getRandom, getRandomBodyY, getRegistryManager, getRemovalReason, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTeam, getServer, getSplashSound, getStackReference, getStandingEyeHeight, getStepHeight, getSteppingBlockState, getSteppingPos, getStepSoundPos, getSwimHeight, getSwimSound, getSyncedPos, getTargetingMargin, getTeamColorValue, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVehicleAttachmentPos, getVelocity, getVelocityAffectingPos, getVelocityMultiplier, getWeaponStack, getWidth, getWorld, getWorldSpawnPos, getX, getY, getYaw, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPlayerRider, hasPortalCooldown, hasVehicle, interact, interactAt, isAlive, isAlwaysInvulnerableTo, isAttackable, isCollidable, isConnectedThroughVehicle, isControlledByPlayer, isCrawling, isCustomNameVisible, isDescending, isFireImmune, isFlappingWings, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInFluid, isInLava, isInPose, isInRange, isInRange, isInSameTeam, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLocalPlayerOrLogicalSideForUpdatingMovement, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isOnRail, isPartOf, isPlayer, isPushable, isPushedByFluids, isRegionUnloaded, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSupportedBy, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, kill, lerpPosAndRotation, lerpYaw, limitFallDistance, lookAt, move, movementInputToVelocity, occludeVibrationSignals, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onDamaged, onDataTrackerUpdate, onExplodedBy, onKilledOther, onLanding, onPassengerLookAround, onPlayerCollision, onRemove, onRemoved, onSpawnPacket, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, queueBlockCollisionCheck, raycast, readNbt, recalculateDimensions, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeCommandTag, removeFromDimension, removePassenger, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetLerp, resetPortalCooldown, resetPosition, rotate, saveNbt, saveSelfNbt, scheduleVelocityUpdate, serverDamage, setAir, setAngles, setBodyYaw, setBoundingBox, setChangeListener, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInPowderSnow, setInvisible, setInvulnerable, setMovement, setNoGravity, setOnFire, setOnFireFor, setOnFireForTicks, setOnFireFromLava, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setPosition, setPrevPositionAndAngles, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, setYaw, shouldControlVehicles, shouldDismountUnderwater, shouldEscapePowderSnow, shouldPlayBurnSoundInLava, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTickBlockCollision, sidedDamage, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleportTo, tickBlockCollision, tickBlockCollision, tickInVoid, tickPortalCooldown, tickPortalTeleportation, tickRiding, toNbtList, toNbtList, toString, tryUsePortal, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updatePrevAngles, updatePrevPosition, updateSupportingBlockPos, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, writeNbt
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.scoreboard.ScoreHolder
getStyledDisplayName
-
Field Details
-
field_30062
private static final int field_30062- See Also:
- Mappings:
Namespace Name Mixin selector named field_30062
Lnet/minecraft/entity/LightningEntity;field_30062:I
intermediary field_30062
Lnet/minecraft/class_1538;field_30062:I
official b
Lbwe;b:I
-
field_33906
private static final double field_33906- See Also:
- Mappings:
Namespace Name Mixin selector named field_33906
Lnet/minecraft/entity/LightningEntity;field_33906:D
intermediary field_33906
Lnet/minecraft/class_1538;field_33906:D
official c
Lbwe;c:D
-
field_33907
private static final double field_33907- See Also:
- Mappings:
Namespace Name Mixin selector named field_33907
Lnet/minecraft/entity/LightningEntity;field_33907:D
intermediary field_33907
Lnet/minecraft/class_1538;field_33907:D
official d
Lbwe;d:D
-
ambientTick
private int ambientTick- Mappings:
Namespace Name Mixin selector named ambientTick
Lnet/minecraft/entity/LightningEntity;ambientTick:I
intermediary field_7185
Lnet/minecraft/class_1538;field_7185:I
official e
Lbwe;e:I
-
seed
public long seed- Mappings:
Namespace Name Mixin selector named seed
Lnet/minecraft/entity/LightningEntity;seed:J
intermediary field_7186
Lnet/minecraft/class_1538;field_7186:J
official a
Lbwe;a:J
-
remainingActions
private int remainingActions- Mappings:
Namespace Name Mixin selector named remainingActions
Lnet/minecraft/entity/LightningEntity;remainingActions:I
intermediary field_7183
Lnet/minecraft/class_1538;field_7183:I
official f
Lbwe;f:I
-
cosmetic
private boolean cosmetic- Mappings:
Namespace Name Mixin selector named cosmetic
Lnet/minecraft/entity/LightningEntity;cosmetic:Z
intermediary field_7184
Lnet/minecraft/class_1538;field_7184:Z
official g
Lbwe;g:Z
-
channeler
- Mappings:
Namespace Name Mixin selector named channeler
Lnet/minecraft/entity/LightningEntity;channeler:Lnet/minecraft/server/network/ServerPlayerEntity;
intermediary field_7182
Lnet/minecraft/class_1538;field_7182:Lnet/minecraft/class_3222;
official h
Lbwe;h:Lasi;
-
struckEntities
- Mappings:
Namespace Name Mixin selector named struckEntities
Lnet/minecraft/entity/LightningEntity;struckEntities:Ljava/util/Set;
intermediary field_33904
Lnet/minecraft/class_1538;field_33904:Ljava/util/Set;
official i
Lbwe;i:Ljava/util/Set;
-
blocksSetOnFire
private int blocksSetOnFire- Mappings:
Namespace Name Mixin selector named blocksSetOnFire
Lnet/minecraft/entity/LightningEntity;blocksSetOnFire:I
intermediary field_33905
Lnet/minecraft/class_1538;field_33905:I
official j
Lbwe;j:I
-
-
Constructor Details
-
LightningEntity
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
intermediary <init>
Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
official <init>
Lbvj;<init>(Lbvq;Ldhh;)V
-
-
Method Details
-
setCosmetic
public void setCosmetic(boolean cosmetic) - Mappings:
Namespace Name Mixin selector named setCosmetic
Lnet/minecraft/entity/LightningEntity;setCosmetic(Z)V
intermediary method_29498
Lnet/minecraft/class_1538;method_29498(Z)V
official a
Lbwe;a(Z)V
-
getSoundCategory
Returns the sound category for sounds from this entity.This is used by
Entity.playSound(SoundEvent, float, float)
and defaults toSoundCategory.NEUTRAL
. Hostile entities should override this to returnSoundCategory.HOSTILE
.- Overrides:
getSoundCategory
in classEntity
- Returns:
- the sound category for sounds from this entity
- See Also:
- Mappings:
Namespace Name Mixin selector named getSoundCategory
Lnet/minecraft/entity/Entity;getSoundCategory()Lnet/minecraft/sound/SoundCategory;
intermediary method_5634
Lnet/minecraft/class_1297;method_5634()Lnet/minecraft/class_3419;
official dn
Lbvj;dn()Laxg;
-
getChanneler
- Mappings:
Namespace Name Mixin selector named getChanneler
Lnet/minecraft/entity/LightningEntity;getChanneler()Lnet/minecraft/server/network/ServerPlayerEntity;
intermediary method_35052
Lnet/minecraft/class_1538;method_35052()Lnet/minecraft/class_3222;
official l
Lbwe;l()Lasi;
-
setChanneler
- Mappings:
Namespace Name Mixin selector named setChanneler
Lnet/minecraft/entity/LightningEntity;setChanneler(Lnet/minecraft/server/network/ServerPlayerEntity;)V
intermediary method_6961
Lnet/minecraft/class_1538;method_6961(Lnet/minecraft/class_3222;)V
official b
Lbwe;b(Lasi;)V
-
powerLightningRod
private void powerLightningRod()- Mappings:
Namespace Name Mixin selector named powerLightningRod
Lnet/minecraft/entity/LightningEntity;powerLightningRod()V
intermediary method_31499
Lnet/minecraft/class_1538;method_31499()V
official s
Lbwe;s()V
-
tick
public void tick()Ticks this entity.- Overrides:
tick
in classEntity
- See Also:
- API Note:
- This can be overridden to add additional logics.
super.tick();
should be called in those cases. - Implementation Note:
- By default, this delegates all logics to
Entity.baseTick()
. - Mappings:
Namespace Name Mixin selector named tick
Lnet/minecraft/entity/Entity;tick()V
intermediary method_5773
Lnet/minecraft/class_1297;method_5773()V
official h
Lbvj;h()V
-
getAffectedBlockPos
- Mappings:
Namespace Name Mixin selector named getAffectedBlockPos
Lnet/minecraft/entity/LightningEntity;getAffectedBlockPos()Lnet/minecraft/util/math/BlockPos;
intermediary method_36607
Lnet/minecraft/class_1538;method_36607()Lnet/minecraft/class_2338;
official t
Lbwe;t()Ljh;
-
spawnFire
private void spawnFire(int spreadAttempts) - Mappings:
Namespace Name Mixin selector named spawnFire
Lnet/minecraft/entity/LightningEntity;spawnFire(I)V
intermediary method_6960
Lnet/minecraft/class_1538;method_6960(I)V
official b
Lbwe;b(I)V
-
cleanOxidation
- Mappings:
Namespace Name Mixin selector named cleanOxidation
Lnet/minecraft/entity/LightningEntity;cleanOxidation(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V
intermediary method_34707
Lnet/minecraft/class_1538;method_34707(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
official a
Lbwe;a(Ldhh;Ljh;)V
-
cleanOxidationAround
private static void cleanOxidationAround(World world, BlockPos pos, BlockPos.Mutable mutablePos, int count) - Mappings:
Namespace Name Mixin selector named cleanOxidationAround
Lnet/minecraft/entity/LightningEntity;cleanOxidationAround(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos$Mutable;I)V
intermediary method_34709
Lnet/minecraft/class_1538;method_34709(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338$class_2339;I)V
official a
Lbwe;a(Ldhh;Ljh;Ljh$a;I)V
-
cleanOxidationAround
- Mappings:
Namespace Name Mixin selector named cleanOxidationAround
Lnet/minecraft/entity/LightningEntity;cleanOxidationAround(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Ljava/util/Optional;
intermediary method_34710
Lnet/minecraft/class_1538;method_34710(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Ljava/util/Optional;
official b
Lbwe;b(Ldhh;Ljh;)Ljava/util/Optional;
-
shouldRender
public boolean shouldRender(double distance) - Overrides:
shouldRender
in classEntity
- Mappings:
Namespace Name Mixin selector named shouldRender
Lnet/minecraft/entity/Entity;shouldRender(D)Z
intermediary method_5640
Lnet/minecraft/class_1297;method_5640(D)Z
official a
Lbvj;a(D)Z
-
initDataTracker
Initializes data tracker.- Specified by:
initDataTracker
in classEntity
- API Note:
- Subclasses should override this and add to the builder any data that needs to be tracked.
- Mappings:
Namespace Name Mixin selector named initDataTracker
Lnet/minecraft/entity/Entity;initDataTracker(Lnet/minecraft/entity/data/DataTracker$Builder;)V
intermediary method_5693
Lnet/minecraft/class_1297;method_5693(Lnet/minecraft/class_2945$class_9222;)V
official a
Lbvj;a(Lalg$a;)V
-
readCustomDataFromNbt
Reads custom data fromnbt
. Subclasses have to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Specified by:
readCustomDataFromNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named readCustomDataFromNbt
Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_5749
Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
official a
Lbvj;a(Lux;)V
-
writeCustomDataToNbt
Writes custom data tonbt
. Subclasses have to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.
- Specified by:
writeCustomDataToNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named writeCustomDataToNbt
Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_5652
Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
official b
Lbvj;b(Lux;)V
-
getBlocksSetOnFire
public int getBlocksSetOnFire()- Mappings:
Namespace Name Mixin selector named getBlocksSetOnFire
Lnet/minecraft/entity/LightningEntity;getBlocksSetOnFire()I
intermediary method_37220
Lnet/minecraft/class_1538;method_37220()I
official m
Lbwe;m()I
-
getStruckEntities
- Mappings:
Namespace Name Mixin selector named getStruckEntities
Lnet/minecraft/entity/LightningEntity;getStruckEntities()Ljava/util/stream/Stream;
intermediary method_37221
Lnet/minecraft/class_1538;method_37221()Ljava/util/stream/Stream;
official p
Lbwe;p()Ljava/util/stream/Stream;
-
damage
Applies a damage to this entity. The exact implementation differs between subclasses.LivingEntity
has health value, and damaging the entity decreases it. This also handles shields, extra damage to helmets for falling blocks, setting the attacker, playing hurt sound, etc.Some entities like
ItemEntity
also have health value, which the overridden method decrements. There also exist several entities, likeEndCrystalEntity
, where any damage discards the entity (perhaps with an explosion).If this is overridden, it must check the result of
invalid reference
#isInvulnerableTo
- Specified by:
damage
in classEntity
- Returns:
- whether the entity was actually damaged
- See Also:
- Mappings:
Namespace Name Mixin selector named damage
Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z
intermediary method_64397
Lnet/minecraft/class_1297;method_64397(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;F)Z
official a
Lbvj;a(Lash;Lbtz;F)Z
-