Class LocalPlayer
- All Implemented Interfaces:
ClientAvatarEntity, DataComponentGetter, TypedInstance<EntityType<?>>, SyncedDataHolder, DebugValueSource, Attackable, ContainerUser, ItemOwner, SlotProvider, EntityAccess, UniquelyIdentifyable, Nameable, ScoreHolder, Waypoint, WaypointTransmitter, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, IPlayerExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class Player
Player.BedSleepingProblemNested classes/interfaces inherited from class LivingEntity
LivingEntity.FallsoundsNested classes/interfaces inherited from class Entity
Entity.Flags, Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T>Nested classes/interfaces inherited from interface ItemOwner
ItemOwner.OffsetFromOwnerNested classes/interfaces inherited from interface Waypoint
Waypoint.IconNested classes/interfaces inherited from interface WaypointTransmitter
WaypointTransmitter.BlockConnection, WaypointTransmitter.ChunkConnection, WaypointTransmitter.Connection, WaypointTransmitter.EntityAzimuthConnection, WaypointTransmitter.EntityBlockConnection, WaypointTransmitter.EntityChunkConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AmbientSoundHandler> private booleanprivate intprivate ChatAbilitiesfinal ClientPacketListenerprivate booleanprivate booleanprivate final TickThrottlerprivate static final intprivate static final intintprivate booleanprivate booleanprivate floatprivate intprivate booleanprivate booleanprivate Inputstatic final org.slf4j.Loggerprotected final Minecraftprivate static final doublefloatprivate PermissionSetfloatprivate static final intprivate intReset to 0 every time position is sent to the server, used to send periodic updates every 20 ticks even when the player is not moving.private final ClientRecipeBookprivate booleanprotected intprivate booleanprivate final StatsCounterprivate static final doubleprivate @Nullable InteractionHandprivate booleanprivate booleanthe last sprinting state sent to the serverprivate static final intprivate static final floatprivate static final intprivate intfloatfloatprivate doubleThe last X position which was transmitted to the server, used to determine when the X position changes and needs to be re-transmittedprivate floatThe last pitch value which was transmitted to the server, used to determine when the pitch changes and needs to be re-transmittedfloatfloatprivate doubleprivate floatThe last yaw value which was transmitted to the server, used to determine when the yaw changes and needs to be re-transmittedprivate doubleThe last Z position which was transmitted to the server, used to determine when the Z position changes and needs to be re-transmittedFields inherited from class Player
containerMenu, CRAFTING_SLOT_OFFSET, CREATIVE_ENTITY_INTERACTION_RANGE_MODIFIER_VALUE, DEFAULT_BLOCK_INTERACTION_RANGE, DEFAULT_ENTITY_INTERACTION_RANGE, defaultFlySpeed, enchantmentSeed, ENDER_SLOT_OFFSET, enderChestInventory, experienceLevel, experienceProgress, fishing, foodData, HELD_ITEM_SLOT, hurtDir, inventoryMenu, jumpTriggerTime, MAX_HEALTH, PERSISTED_NBT_TAG, SLEEP_DURATION, takeXpDelay, totalExperience, WAKE_UP_DURATION, wasUnderwaterFields inherited from class Avatar
DATA_PLAYER_MAIN_HAND, DATA_PLAYER_MODE_CUSTOMISATION, DEFAULT_EYE_HEIGHT, DEFAULT_MAIN_HAND, DEFAULT_MODEL_CUSTOMIZATION, DEFAULT_VEHICLE_ATTACHMENT, POSES, STANDING_DIMENSIONS, SWIMMING_BB_HEIGHTFields inherited from class LivingEntity
ARMOR_SLOT_OFFSET, attackAnim, attackStrengthTicker, autoSpinAttackDmg, autoSpinAttackItemStack, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, currentExplosionCause, currentImpulseImpactPos, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, DEFAULT_KNOCKBACK, elytraAnimationState, equipment, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, hurtDuration, hurtTime, INPUT_FRICTION, interpolation, INVULNERABLE_DURATION, itemSwapTicker, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerMemoryTime, lerpHeadSteps, lerpYHeadRot, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, PLAYER_HURT_EXPERIENCE_TIME, PLAYER_NOT_WEARING_DISGUISE_ITEM, PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET, recentKineticEnemies, removeArrowTime, removeStingerTime, SADDLE_OFFSET, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, TAG_ATTRIBUTES, TAG_BRAIN, TAG_DEATH_TIME, TAG_EQUIPMENT, TAG_FALL_FLYING, TAG_HEALTH, TAG_HURT_BY_TIMESTAMP, TAG_HURT_TIME, TAG_SLEEPING_POS, useItem, useItemRemaining, walkAnimation, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zzaFields inherited from class Entity
BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, horizontalCollision, hurtMarked, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, needsSync, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, TAG_CUSTOM_NAME, TAG_DATA, TAG_FALL_DISTANCE, TAG_FIRE, TAG_GLOWING, TAG_ID, TAG_INVULNERABLE, TAG_MOTION, TAG_NO_GRAVITY, TAG_ON_GROUND, TAG_PASSENGERS, TAG_PORTAL_COOLDOWN, TAG_POS, TAG_ROTATION, TAG_SILENT, TAG_UUID, tickCount, TOTAL_AIR_SUPPLY, uuid, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface ScoreHolder
WILDCARD, WILDCARD_NAMEFields inherited from interface Waypoint
MAX_RANGE, WAYPOINT_TRANSMIT_RANGE_HIDE_MODIFIERFields inherited from interface WaypointTransmitter
REALLY_FAR_DISTANCE -
Constructor Summary
ConstructorsConstructorDescriptionLocalPlayer(Minecraft minecraft, ClientLevel level, ClientPacketListener connection, StatsCounter stats, ClientRecipeBook recipeBook, Input lastSentInput, boolean wasSprinting, ChatAbilities chatAbilities) -
Method Summary
Modifier and TypeMethodDescriptionvoidaiStep()voidprivate booleanbooleanbooleanprivate booleanvoidvoidvoidCalled when the entity is dealt a critical hit.private static floatdistanceToUnitSquare(Vec2 direction) booleandrop(boolean all) private static HitResultfilterHitResult(HitResult hitResult, Vec3 from, double maxRange) floatbooleanfloatgetRopeHoldPosition(float partialTickTime) getStats()floatgetViewXRot(float a) Gets the current pitch of the entity.floatgetViewYRot(float a) Gets the current yaw of the entityfloatfloatvoidvoidhandleEntityEvent(byte id) Handler forinvalid reference
World#setEntityStateprivate voidhandlePortalTransitionEffect(boolean active) voidheal(float heal) Heal living entity (param: amount of half-hearts)voidhurtTo(float newHealth) Updates health locally.booleanprotected booleanbooleanbooleanprotected booleanisHorizontalCollisionMinor(Vec3 movement) booleanprivate booleanisMoving()booleanbooleanprivate booleanprivate booleanisSprintingPossible(boolean allowedInShallowWater) booleanbooleanbooleanbooleanprivate float@Nullable PlayerRideableJumpingvoidprivate Vec2modifyInput(Vec2 input) private static Vec2voidprivate voidmoveTowardsClosestSpace(double x, double z) voidonGameModeChanged(GameType gameType) voidonSyncedDataUpdated(EntityDataAccessor<?> accessor) voidvoidopenCommandBlock(CommandBlockEntity commandBlock) voidopenDialog(Holder<Dialog> dialog) voidopenItemGui(ItemStack itemStack, InteractionHand hand) voidopenJigsawBlock(JigsawBlockEntity jigsawBlock) voidopenMinecartCommandBlock(MinecartCommandBlock commandBlock) voidopenStructureBlock(StructureBlockEntity structureBlock) voidopenTestBlock(TestBlockEntity testBlock) voidopenTestInstanceBlock(TestInstanceBlockEntity testInstanceBlock) voidopenTextEdit(SignBlockEntity sign, boolean isFrontText) private static HitResultpick(Entity cameraEntity, double blockInteractionRange, double entityInteractionRange, float partialTicks) voidplaySound(SoundEvent sound, float volume, float pitch) raycastHitResult(float a, Entity cameraEntity) voidvoidremoveRecipeHighlight(RecipeDisplayId recipe) voidvoidresetPos()voidrespawn()voidrideTick()private voidvoidvoidsendOverlayMessage(Component message) private voidprotected voidvoidsendSystemMessage(Component message) voidsetDoLimitedCrafting(boolean value) private voidvoidsetExperienceValues(float experienceProgress, int totalExp, int experienceLevel) Sets the current XP, total XP, and level number.voidsetPermissions(PermissionSet newPermissions) voidsetReducedDebugInfo(boolean reducedDebugInfo) voidsetShowDeathScreen(boolean show) booleanbooleanprivate booleanprivate booleanbooleanstartRiding(Entity entity, boolean force, boolean sendEventAndTriggers) voidvoidprivate booleansuffocatesAt(BlockPos pos) voidswing(InteractionHand hand) voidtick()protected voidprotected voidupdateAutoJump(float xa, float za) protected booleanvoidupdateTutorialInventoryAction(ItemStack itemCarried, ItemStack itemInSlot, ClickAction clickAction) private booleanvehicleCanSprint(Entity vehicle) Methods inherited from class AbstractClientPlayer
addWalkedDistance, avatarState, belowNameDisplay, gameMode, getFieldOfViewModifier, getParrotVariantOnShoulder, getPlayerInfo, getSkin, showExtraEars, updateBobMethods inherited from class Player
actuallyHurt, addAdditionalSaveData, addItem, animateHurt, attack, awardRecipes, awardRecipesByKey, awardStat, awardStat, awardStat, awardStat, blockActionRestricted, blockInteractionRange, blockUsingItem, canBeSeenAsEnemy, canEat, canGlide, canHarmPlayer, cannotAttackWithItem, canPlayerFitWithinBlocksAndEntitiesWhen, canSimulateMovement, canSprint, canUseGameMasterBlocks, causeExtraKnockback, causeFallDamage, causeFoodExhaustion, convertParrotVariant, createAttributes, createEquipment, createItemCooldowns, debugInfo, defineSynchedData, destroyVanishingCursedItems, die, doAutoAttackOnTouch, doCloseContainer, doesEmitEquipEvent, doWaterSplashEffect, drop, dropEquipment, entityInteractionRange, extractParrotVariant, freeAt, getAbilities, getAbsorptionAmount, getAttackStrengthScale, getBaseExperienceReward, getBlockSpeedFactor, getContainerInteractionRange, getCooldowns, getCurrentItemAttackStrengthDelay, getDeathSound, getDestroySpeed, getDestroySpeed, getDimensionChangingDelay, getDismountPoses, getDisplayName, getEnchantedDamage, getEnchantmentSeed, getEnderChestInventory, getFallSounds, getFireImmuneTicks, getFlyingSpeed, getFoodData, getForcedPose, getGameProfile, getHurtDir, getHurtSound, getInventory, getItemSwapScale, getLastDeathLocation, getLuck, getMaxHeadRotationRelativeToBody, getMovementEmission, getName, getPlainTextName, getPrefixes, getProjectile, getScore, getScoreboardName, getShoulderParrotLeft, getShoulderParrotRight, getSleepTimer, getSlot, getSoundSource, getSpeed, getSuffixes, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getVoicePitch, getWardenSpawnTracker, getWeaponItem, getXpNeededForNextLevel, giveExperienceLevels, giveExperiencePoints, handleShoulderEntities, hasContainerOpen, hasContainerOpen, hasCorrectToolForDrops, hasCorrectToolForDrops, hasEnoughFoodToDoExhaustiveManoeuvres, hasInfiniteMaterials, hurtArmor, hurtHelmet, hurtServer, increaseScore, interactOn, internalSetAbsorptionAmount, isAffectedByFluids, isAlwaysExperienceDropper, isAlwaysTicking, isClientAuthoritative, isCreative, isEffectiveAi, isHurt, isImmobile, isInvulnerableTo, isLocalClientAuthoritative, isMobilityRestricted, isPickable, isPushedByFluid, isReducedDebugInfo, isScoping, isSecondaryUseActive, isSleepingLongEnough, isSpectator, isStayingOnGroundSurface, isSwimming, isWithinAttackRange, isWithinBlockInteractionRange, isWithinEntityInteractionRange, isWithinEntityInteractionRange, killedEntity, makeStuckInBlock, maybeBackOffFromEdge, mayBuild, mayUseItemAt, nameAndId, onAboveBubbleColumn, onAttack, onClimbable, onEnchantmentPerformed, onInsideBubbleColumn, openHorseInventory, openMenu, openNautilusInventory, playStepSound, preventsBlockDrops, readAdditionalSaveData, refreshDisplayName, remove, removeEntitiesOnShoulder, resetAttackStrengthTicker, resetOnlyAttackStrengthTicker, resetRecipes, resetStat, sendMerchantOffers, setForcedPose, setLastDeathLocation, setRemainingFireTicks, setScore, setShoulderParrotLeft, setShoulderParrotRight, shouldBeSaved, shouldShowName, stabAttack, startAutoSpinAttack, startFallFlying, startSleepInBed, stopSleepInBed, stopSleeping, tickRegeneration, travel, triggerRecipeCrafted, tryToStartFallFlying, updatePlayerPose, updateSwimming, wantsToStopRidingMethods inherited from class Avatar
getDefaultDimensions, getMainArm, isModelPartShown, setMainArmMethods inherited from class LivingEntity
activeLocationDependentEnchantments, addEffect, addEffect, applyItemBlocking, applyPostImpulseGraceTime, areAllEffectsAmbient, asLivingEntity, attackable, baseTick, blockedByItem, calculateEntityAnimation, calculateFallDamage, canAttack, canBeAffected, canBeSeenByAnyone, canBreatheUnderwater, canDispenserEquipIntoSlot, canEquipWithDispenser, canFreeze, canGlideUsing, canPickUpLoot, canStandOnFluid, canUsePortal, canUseSlot, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, doHurtEquipment, doHurtTarget, doPush, drop, dropAllDeathLoot, dropCustomDeathLoot, dropExperience, dropFromEntityInteractLootTable, dropFromGiftLootTable, dropFromLootTable, dropFromLootTable, dropFromLootTable, dropFromLootTable, dropFromShearingLootTable, equipmentHasChanged, forceAddEffect, getActiveEffects, getActiveEffectsMap, getActiveItem, getAgeScale, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttackRangeWith, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBrain, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDefaultGravity, getDimensions, getEffect, getEffectBlendFactor, getEffectiveGravity, getEquipmentSlotForItem, getEquipSound, getExperienceReward, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getHitbox, getInterpolation, getItemBlockingWith, getItemBySlot, getItemHeldByArm, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getKnockback, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtByPlayer, getLastHurtByPlayerMemoryTime, getLastHurtMob, getLastHurtMobTimestamp, getLiquidCollisionShape, getLocalBoundsForPose, getLootTableSeed, getMainHandItem, getMaxAbsorption, getMaxFallDistance, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSecondsToDisableBlocking, getSleepingPos, getSoundVolume, getStingerCount, getSwimAmount, getTicksSinceLastKineticHitFeedback, getTicksUsingItem, getTicksUsingItem, getUseItem, getUseItemRemainingTicks, getVisibilityPercent, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleExtraItemsCreatedOnUse, hasEffect, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, hasLineOfSight, igniteForTicks, increaseAirSupply, indicateDamage, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDeadOrDying, isEquippableInSlot, isFallFlying, isHolding, isHolding, isIgnoringFallDamageFromCurrentImpulse, isInPostImpulseGraceTime, isInvertedHealAndHarm, isInWall, isJumping, isLookingAtMe, isPushable, isSensitiveToWater, isSleeping, isTransmittingWaypoint, isVisuallySwimming, jumpFromGround, jumpInLiquid, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lookAt, makeBrain, makePoofParticles, makeSound, makeWaypointConnectionWith, maxUpStep, onAttributeUpdated, onBelowWorld, onChangedBlock, onEffectAdded, onEffectsRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, onRemoval, playAttackSound, playBlockFallSound, playHurtSound, postPiercingAttack, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, rememberStabbedEntity, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, resetCurrentImpulseContext, resetForwardDirectionOfRelativePortalPosition, resolveMobResponsibleForDamage, resolvePlayerResponsibleForDamage, sanitizeScale, sendEffectToPassengers, serverAiStep, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setIgnoreFallDamageFromCurrentImpulse, setItemInHand, setItemSlot, setItemSlot, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSpeed, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldTakeDrowningDamage, shouldTravelInFluid, skipDropExperience, spawnItemParticles, stabbedEntities, startSleeping, stopFallFlying, stopRiding, swing, take, tickEffects, tickHeadTurn, tickRidden, travelFlying, travelFlying, travelInWater, triggerOnDeathMobEffects, tryAddFrost, tryResetCurrentImpulseContext, updateDataBeforeSync, updateEffectVisibility, updateFallFlying, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, wasExperienceConsumed, wasRecentlyStabbed, waypointIcon, wouldNotSuffocateAtTargetPoseMethods inherited from class Entity
absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canControlVehicle, canInteractWithLevel, canRide, canTeleport, canTrample, captureDrops, captureDrops, castComponentValue, checkBelowWorld, checkDespawn, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collectAllColliders, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, computeSpeed, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, dropAllLeashConnections, ejectPassengers, entityTags, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, getAvailableSpaceBelow, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDirection, getDismountLocationForPassenger, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getHeadLookAngle, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, getKnownSpeed, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getQuadLeashHolderOffsets, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRequiresPrecisePosition, getRootVehicle, getRotationVector, getSelfAndPassengers, getSharedFlag, getStringUUID, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getX, getX, getXRot, getXRot, getY, getY, getYRot, getYRot, getZ, getZ, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasMovedHorizontallyRecently, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, ignoreExplosion, interact, is, isAddedToLevel, isAffectedByBlocks, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isIgnoringBlockTriggers, isInClouds, isInFluidType, isInFluidType, isInLava, isInLiquid, isInShallowWater, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInWater, isInWaterOrRain, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isSilent, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isVehicle, isVisuallyCrawling, lavaHurt, lavaIgnite, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeBoundingBox, markHurt, mayInteract, mirror, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, notifyLeasheeRemoved, notifyLeashHolder, oldPosition, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSwimSound, position, positionRider, positionRider, problemPath, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, reapplyPosition, refreshDimensions, registerDebugValues, registryAccess, removeAfterChangingDimensions, removeLatestMovementRecording, removePassenger, removeTag, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemoved, setRequiresPrecisePosition, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shearOffAllLeashConnections, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, supportQuadLeashAsHolder, syncData, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, typeHolder, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoCanPushEntityFluidPushing, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, waterSwimSoundMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from interface ContainerUser
getLivingEntityMethods inherited from interface DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, hasMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, shouldRiderSitMethods inherited from interface ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface IPlayerExtension
isCloseEnough, isFakePlayer, mayFly, openMenu, openMenuMethods inherited from interface ScoreHolder
getFeedbackDisplayNameMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER -
POSITION_REMINDER_INTERVAL
private static final int POSITION_REMINDER_INTERVAL- See Also:
-
WATER_VISION_MAX_TIME
private static final int WATER_VISION_MAX_TIME- See Also:
-
WATER_VISION_QUICK_TIME
private static final int WATER_VISION_QUICK_TIME- See Also:
-
WATER_VISION_QUICK_PERCENT
private static final float WATER_VISION_QUICK_PERCENT- See Also:
-
SUFFOCATING_COLLISION_CHECK_SCALE
private static final double SUFFOCATING_COLLISION_CHECK_SCALE- See Also:
-
MINOR_COLLISION_ANGLE_THRESHOLD_RADIAN
private static final double MINOR_COLLISION_ANGLE_THRESHOLD_RADIAN- See Also:
-
connection
-
stats
-
recipeBook
-
dropSpamThrottler
-
ambientSoundHandlers
-
permissions
-
chatAbilities
-
xLast
private double xLastThe last X position which was transmitted to the server, used to determine when the X position changes and needs to be re-transmitted -
yLast
private double yLast -
zLast
private double zLastThe last Z position which was transmitted to the server, used to determine when the Z position changes and needs to be re-transmitted -
yRotLast
private float yRotLastThe last yaw value which was transmitted to the server, used to determine when the yaw changes and needs to be re-transmitted -
xRotLast
private float xRotLastThe last pitch value which was transmitted to the server, used to determine when the pitch changes and needs to be re-transmitted -
lastOnGround
private boolean lastOnGround -
lastHorizontalCollision
private boolean lastHorizontalCollision -
crouching
private boolean crouching -
wasSprinting
private boolean wasSprintingthe last sprinting state sent to the server -
positionReminder
private int positionReminderReset to 0 every time position is sent to the server, used to send periodic updates every 20 ticks even when the player is not moving. -
flashOnSetHealth
private boolean flashOnSetHealth -
input
-
lastSentInput
-
minecraft
-
sprintTriggerTime
protected int sprintTriggerTime -
EXPERIENCE_DISPLAY_UNREADY_TO_SET
private static final int EXPERIENCE_DISPLAY_UNREADY_TO_SET- See Also:
-
EXPERIENCE_DISPLAY_READY_TO_SET
private static final int EXPERIENCE_DISPLAY_READY_TO_SET- See Also:
-
experienceDisplayStartTick
public int experienceDisplayStartTick -
yBob
public float yBob -
xBob
public float xBob -
yBobO
public float yBobO -
xBobO
public float xBobO -
jumpRidingTicks
private int jumpRidingTicks -
jumpRidingScale
private float jumpRidingScale -
portalEffectIntensity
public float portalEffectIntensity -
oPortalEffectIntensity
public float oPortalEffectIntensity -
startedUsingItem
private boolean startedUsingItem -
usingItemHand
-
handsBusy
private boolean handsBusy -
autoJumpEnabled
private boolean autoJumpEnabled -
autoJumpTime
private int autoJumpTime -
wasFallFlying
private boolean wasFallFlying -
waterVisionTime
private int waterVisionTime -
showDeathScreen
private boolean showDeathScreen -
doLimitedCrafting
private boolean doLimitedCrafting
-
-
Constructor Details
-
LocalPlayer
public LocalPlayer(Minecraft minecraft, ClientLevel level, ClientPacketListener connection, StatsCounter stats, ClientRecipeBook recipeBook, Input lastSentInput, boolean wasSprinting, ChatAbilities chatAbilities)
-
-
Method Details
-
heal
public void heal(float heal) Heal living entity (param: amount of half-hearts)- Overrides:
healin classLivingEntity
-
startRiding
- Overrides:
startRidingin classEntity
-
removeVehicle
public void removeVehicle()- Overrides:
removeVehiclein classPlayer
-
getViewXRot
public float getViewXRot(float a) Gets the current pitch of the entity.- Overrides:
getViewXRotin classEntity
-
getViewYRot
public float getViewYRot(float a) Gets the current yaw of the entity- Overrides:
getViewYRotin classLivingEntity
-
tick
public void tick()- Overrides:
tickin classAbstractClientPlayer
-
getCurrentMood
public float getCurrentMood() -
sendPosition
private void sendPosition() -
sendIsSprintingIfNeeded
private void sendIsSprintingIfNeeded() -
drop
public boolean drop(boolean all) -
swing
- Overrides:
swingin classLivingEntity
-
respawn
public void respawn() -
closeContainer
public void closeContainer()- Overrides:
closeContainerin classPlayer
-
clientSideCloseContainer
public void clientSideCloseContainer() -
hurtTo
public void hurtTo(float newHealth) Updates health locally. -
onUpdateAbilities
public void onUpdateAbilities()- Overrides:
onUpdateAbilitiesin classPlayer
-
setReducedDebugInfo
public void setReducedDebugInfo(boolean reducedDebugInfo) - Overrides:
setReducedDebugInfoin classPlayer
-
isLocalPlayer
public boolean isLocalPlayer()- Overrides:
isLocalPlayerin classPlayer
-
isSuppressingSlidingDownLadder
public boolean isSuppressingSlidingDownLadder()- Overrides:
isSuppressingSlidingDownLadderin classLivingEntity
-
canSpawnSprintParticle
public boolean canSpawnSprintParticle()- Overrides:
canSpawnSprintParticlein classEntity
-
sendRidingJump
protected void sendRidingJump() -
sendOpenInventory
public void sendOpenInventory() -
getStats
-
getRecipeBook
-
removeRecipeHighlight
-
permissions
- Overrides:
permissionsin classPlayer
-
setPermissions
-
chatAbilities
-
refreshChatAbilities
public void refreshChatAbilities() -
sendSystemMessage
- Overrides:
sendSystemMessagein classPlayer
-
sendOverlayMessage
- Overrides:
sendOverlayMessagein classPlayer
-
moveTowardsClosestSpace
private void moveTowardsClosestSpace(double x, double z) -
suffocatesAt
-
setExperienceValues
public void setExperienceValues(float experienceProgress, int totalExp, int experienceLevel) Sets the current XP, total XP, and level number. -
setExperienceDisplayStartTickToTickCount
private void setExperienceDisplayStartTickToTickCount() -
handleEntityEvent
public void handleEntityEvent(byte id) Description copied from class:LivingEntityHandler forinvalid reference
World#setEntityState- Overrides:
handleEntityEventin classPlayer
-
setShowDeathScreen
public void setShowDeathScreen(boolean show) -
shouldShowDeathScreen
public boolean shouldShowDeathScreen() -
setDoLimitedCrafting
public void setDoLimitedCrafting(boolean value) -
getDoLimitedCrafting
public boolean getDoLimitedCrafting() -
playSound
-
startUsingItem
- Overrides:
startUsingItemin classLivingEntity
-
isUsingItem
public boolean isUsingItem()- Overrides:
isUsingItemin classLivingEntity
-
isSlowDueToUsingItem
private boolean isSlowDueToUsingItem() -
itemUseSpeedMultiplier
private float itemUseSpeedMultiplier() -
stopUsingItem
public void stopUsingItem()- Overrides:
stopUsingItemin classLivingEntity
-
getUsedItemHand
- Overrides:
getUsedItemHandin classLivingEntity
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdatedin interfaceSyncedDataHolder- Overrides:
onSyncedDataUpdatedin classLivingEntity
-
jumpableVehicle
-
getJumpRidingScale
public float getJumpRidingScale() -
isTextFilteringEnabled
public boolean isTextFilteringEnabled()- Overrides:
isTextFilteringEnabledin classPlayer
-
openTextEdit
- Overrides:
openTextEditin classPlayer
-
openMinecartCommandBlock
- Overrides:
openMinecartCommandBlockin classPlayer
-
openCommandBlock
- Overrides:
openCommandBlockin classPlayer
-
openStructureBlock
- Overrides:
openStructureBlockin classPlayer
-
openTestBlock
- Overrides:
openTestBlockin classPlayer
-
openTestInstanceBlock
- Overrides:
openTestInstanceBlockin classPlayer
-
openJigsawBlock
- Overrides:
openJigsawBlockin classPlayer
-
openDialog
- Overrides:
openDialogin classPlayer
-
openItemGui
- Overrides:
openItemGuiin classPlayer
-
crit
-
magicCrit
-
isShiftKeyDown
public boolean isShiftKeyDown()- Overrides:
isShiftKeyDownin classEntity
-
isCrouching
public boolean isCrouching()- Overrides:
isCrouchingin classEntity
-
isMovingSlowly
public boolean isMovingSlowly() -
applyInput
public void applyInput()- Overrides:
applyInputin classLivingEntity
-
modifyInput
-
modifyInputSpeedForSquareMovement
-
distanceToUnitSquare
-
isControlledCamera
protected boolean isControlledCamera() -
resetPos
public void resetPos() -
aiStep
public void aiStep()- Overrides:
aiStepin classAbstractClientPlayer
-
shouldStopRunSprinting
private boolean shouldStopRunSprinting() -
shouldStopSwimSprinting
private boolean shouldStopSwimSprinting() -
getActivePortalLocalTransition
-
tickDeath
protected void tickDeath()- Overrides:
tickDeathin classLivingEntity
-
handlePortalTransitionEffect
private void handlePortalTransitionEffect(boolean active) -
rideTick
public void rideTick()- Overrides:
rideTickin classAbstractClientPlayer
-
isHandsBusy
public boolean isHandsBusy() -
move
-
isAutoJumpEnabled
public boolean isAutoJumpEnabled() -
shouldRotateWithMinecart
public boolean shouldRotateWithMinecart()- Overrides:
shouldRotateWithMinecartin classPlayer
-
updateAutoJump
protected void updateAutoJump(float xa, float za) -
isHorizontalCollisionMinor
- Overrides:
isHorizontalCollisionMinorin classEntity
-
canAutoJump
private boolean canAutoJump() -
isMoving
private boolean isMoving() -
isSprintingPossible
private boolean isSprintingPossible(boolean allowedInShallowWater) -
canStartSprinting
private boolean canStartSprinting() -
vehicleCanSprint
-
getWaterVision
public float getWaterVision() -
onGameModeChanged
-
isUnderWater
public boolean isUnderWater()- Overrides:
isUnderWaterin classEntity
-
updateIsUnderwater
protected boolean updateIsUnderwater()- Overrides:
updateIsUnderwaterin classPlayer
-
getRopeHoldPosition
- Overrides:
getRopeHoldPositionin classPlayer
-
updateTutorialInventoryAction
public void updateTutorialInventoryAction(ItemStack itemCarried, ItemStack itemInSlot, ClickAction clickAction) - Overrides:
updateTutorialInventoryActionin classPlayer
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Specified by:
getVisualRotationYInDegreesin interfaceItemOwner- Overrides:
getVisualRotationYInDegreesin classLivingEntity
-
handleCreativeModeItemDrop
- Overrides:
handleCreativeModeItemDropin classPlayer
-
canDropItems
public boolean canDropItems()- Overrides:
canDropItemsin classPlayer
-
getDropSpamThrottler
-
getLastSentInput
-
raycastHitResult
-
pick
-
filterHitResult
-