Package net.minecraft.client.player
Class LocalPlayer
- All Implemented Interfaces:
DataComponentGetter
,SyncedDataHolder
,Attackable
,EntityAccess
,UniquelyIdentifyable
,Nameable
,ScoreHolder
,Waypoint
,WaypointTransmitter
,IAttachmentHolder
,IEntityExtension
,ILivingEntityExtension
,IPlayerExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.player.Player
Player.BedSleepingProblem
Nested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity
LivingEntity.Fallsounds
Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.waypoints.Waypoint
Waypoint.Icon
Nested classes/interfaces inherited from interface net.minecraft.world.waypoints.WaypointTransmitter
WaypointTransmitter.BlockConnection, WaypointTransmitter.ChunkConnection, WaypointTransmitter.Connection, WaypointTransmitter.EntityAzimuthConnection, WaypointTransmitter.EntityBlockConnection, WaypointTransmitter.EntityChunkConnection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<AmbientSoundHandler> private boolean
private int
final ClientPacketListener
private boolean
private boolean
private final TickThrottler
int
private boolean
private boolean
private float
private int
private boolean
private boolean
private Input
static final org.slf4j.Logger
protected final Minecraft
private static final double
float
private int
float
private static final int
private int
Reset 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 ClientRecipeBook
private boolean
protected int
private boolean
private final StatsCounter
private static final double
static final float
private InteractionHand
private boolean
private boolean
the last sprinting state sent to the serverprivate static final int
private static final float
private static final int
private int
float
float
private double
The last X position which was transmitted to the server, used to determine when the X position changes and needs to be re-transmittedprivate float
The last pitch value which was transmitted to the server, used to determine when the pitch changes and needs to be re-transmittedfloat
float
private double
private float
The last yaw value which was transmitted to the server, used to determine when the yaw changes and needs to be re-transmittedprivate double
The 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 net.minecraft.client.player.AbstractClientPlayer
clientLevel, deltaMovementOnPreviousTick, elytraRotX, elytraRotY, elytraRotZ, walkDist, walkDistO
Fields inherited from class net.minecraft.world.entity.player.Player
bob, CLIENT_LOADED_TIMEOUT_TIME, clientLoadedTimeoutTimer, containerMenu, CRAFTING_SLOT_OFFSET, CROUCH_BB_HEIGHT, currentExplosionCause, currentImpulseImpactPos, DATA_PLAYER_MAIN_HAND, DATA_PLAYER_MODE_CUSTOMISATION, DATA_SHOULDER_LEFT, DATA_SHOULDER_RIGHT, DEFAULT_BLOCK_INTERACTION_RANGE, DEFAULT_ENTITY_INTERACTION_RANGE, DEFAULT_EYE_HEIGHT, DEFAULT_MAIN_HAND, DEFAULT_MODEL_CUSTOMIZATION, DEFAULT_VEHICLE_ATTACHMENT, defaultFlySpeed, enchantmentSeed, ENDER_SLOT_OFFSET, enderChestInventory, experienceLevel, experienceProgress, fishing, foodData, HELD_ITEM_SLOT, hurtDir, inventoryMenu, jumpTriggerTime, MAX_HEALTH, oBob, PERSISTED_NBT_TAG, SLEEP_DURATION, STANDING_DIMENSIONS, SWIMMING_BB_HEIGHT, SWIMMING_BB_WIDTH, takeXpDelay, totalExperience, WAKE_UP_DURATION, wasUnderwater, xCloak, xCloakO, yCloak, yCloakO, zCloak, zCloakO
Fields inherited from class net.minecraft.world.entity.LivingEntity
ARMOR_SLOT_OFFSET, attackAnim, attackStrengthTicker, autoSpinAttackDmg, autoSpinAttackItemStack, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, elytraAnimationState, equipment, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, hurtDuration, hurtTime, INPUT_FRICTION, interpolation, invulnerableDuration, 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, removeArrowTime, removeStingerTime, SADDLE_OFFSET, SLEEPING_DIMENSIONS, SWING_DURATION, 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, zza
Fields inherited from class net.minecraft.world.entity.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, hasImpulse, horizontalCollision, hurtMarked, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, minorHorizontalCollision, moveDist, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, TAG_AIR, 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, zOld
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME
Fields inherited from interface net.minecraft.world.waypoints.Waypoint
MAX_RANGE, WAYPOINT_TRANSMIT_RANGE_HIDE_MODIFIER
Fields inherited from interface net.minecraft.world.waypoints.WaypointTransmitter
REALLY_FAR_DISTANCE
-
Constructor Summary
ConstructorsConstructorDescriptionLocalPlayer
(Minecraft pMinecraft, ClientLevel pLevel, ClientPacketListener pConnection, StatsCounter pStats, ClientRecipeBook pRecipeBook, Input pLastSentInput, boolean pWasSprinting) -
Method Summary
Modifier and TypeMethodDescriptionvoid
aiStep()
void
private boolean
boolean
boolean
private boolean
void
void
void
Called when the entity is dealt a critical hit.void
displayClientMessage
(Component pChatComponent, boolean pActionBar) private static float
distanceToUnitSquare
(Vec2 pMoveVector) boolean
drop
(boolean pFullStack) float
boolean
float
int
getRopeHoldPosition
(float pPartialTick) getStats()
float
getViewXRot
(float pPartialTick) Gets the current pitch of the entity.float
getViewYRot
(float pPartialTick) Gets the current yaw of the entityfloat
float
void
handleCreativeModeItemDrop
(ItemStack pStack) void
handleEntityEvent
(byte pId) Handler forinvalid reference
World#setEntityState
private void
handlePortalTransitionEffect
(boolean pInPortal) private boolean
private boolean
void
heal
(float pHealAmount) Heal living entity (param: amount of half-hearts)void
hurtTo
(float pHealth) Updates health locally.boolean
protected boolean
boolean
boolean
protected boolean
isHorizontalCollisionMinor
(Vec3 pDeltaMovement) boolean
private boolean
isMoving()
boolean
boolean
boolean
boolean
boolean
boolean
void
private Vec2
modifyInput
(Vec2 pMoveVector) private static Vec2
modifyInputSpeedForSquareMovement
(Vec2 pMoveVector) void
private void
moveTowardsClosestSpace
(double pX, double pZ) void
onGameModeChanged
(GameType pGameMode) void
onSyncedDataUpdated
(EntityDataAccessor<?> pKey) void
void
openCommandBlock
(CommandBlockEntity pCommandBlock) void
openDialog
(Holder<Dialog> pDialog) void
openItemGui
(ItemStack pStack, InteractionHand pHand) void
openJigsawBlock
(JigsawBlockEntity pJigsawBlockEntity) void
openMinecartCommandBlock
(BaseCommandBlock pCommandBlock) void
openStructureBlock
(StructureBlockEntity pStructure) void
openTestBlock
(TestBlockEntity pTestBlockEntity) void
openTestInstanceBlock
(TestInstanceBlockEntity pTestInstanceBlockEntity) void
openTextEdit
(SignBlockEntity pSignEntity, boolean pIsFrontText) void
playNotifySound
(SoundEvent pSound, SoundSource pSource, float pVolume, float pPitch) void
playSound
(SoundEvent pSound, float pVolume, float pPitch) void
removeRecipeHighlight
(RecipeDisplayId pRecipe) void
void
resetPos()
void
respawn()
void
rideTick()
private void
void
private void
protected void
void
setDoLimitedCrafting
(boolean pDoLimitedCrafting) void
setExperienceValues
(float pCurrentXP, int pMaxXP, int pLevel) Sets the current XP, total XP, and level number.void
setPermissionLevel
(int pPermissionLevel) void
setShowDeathScreen
(boolean pShow) boolean
boolean
private boolean
private boolean
boolean
startRiding
(Entity pEntity, boolean pForce) void
startUsingItem
(InteractionHand pHand) void
private boolean
suffocatesAt
(BlockPos pPos) void
swing
(InteractionHand pHand) void
tick()
protected void
protected void
updateAutoJump
(float pMovementX, float pMovementZ) protected boolean
void
updateTutorialInventoryAction
(ItemStack pCarried, ItemStack pClicked, ClickAction pAction) private boolean
vehicleCanSprint
(Entity pVehicle) Methods inherited from class net.minecraft.client.player.AbstractClientPlayer
gameMode, getDeltaMovementLerped, getFieldOfViewModifier, getPlayerInfo, getSkin
Methods inherited from class net.minecraft.world.entity.player.Player
actuallyHurt, addAdditionalSaveData, addItem, animateHurt, attack, awardRecipes, awardRecipesByKey, awardStat, awardStat, awardStat, awardStat, blockActionRestricted, blockInteractionRange, blockUsingItem, canBeHitByProjectile, canBeSeenAsEnemy, canEat, canGlide, canHarmPlayer, canInteractWithBlock, canInteractWithEntity, canInteractWithEntity, canPlayerFitWithinBlocksAndEntitiesWhen, canSimulateMovement, canSprint, canUseGameMasterBlocks, causeFallDamage, causeFoodExhaustion, createAttributes, createEquipment, createItemCooldowns, debugInfo, defineSynchedData, destroyVanishingCursedItems, die, doAutoAttackOnTouch, doCloseContainer, doesEmitEquipEvent, doWaterSplashEffect, drop, dropEquipment, entityInteractionRange, freeAt, getAbilities, getAbsorptionAmount, getAttackStrengthScale, getBaseExperienceReward, getBlockSpeedFactor, getCooldowns, getCurrentItemAttackStrengthDelay, getDeathSound, getDefaultDimensions, getDestroySpeed, getDestroySpeed, getDimensionChangingDelay, getDismountPoses, getDisplayName, getEnchantedDamage, getEnchantmentSeed, getEnderChestInventory, getFallSounds, getFireImmuneTicks, getFlyingSpeed, getFoodData, getForcedPose, getGameProfile, getHurtDir, getHurtSound, getInventory, getLastDeathLocation, getLuck, getMainArm, getMaxHeadRotationRelativeToBody, getMovementEmission, getName, getPrefixes, getProjectile, getScore, getScoreboard, getScoreboardName, getShoulderEntityLeft, getShoulderEntityRight, getSleepTimer, getSlot, getSoundSource, getSpeed, getSuffixes, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getWardenSpawnTracker, getWeaponItem, getXpNeededForNextLevel, giveExperienceLevels, giveExperiencePoints, hasClientLoaded, hasContainerOpen, hasCorrectToolForDrops, hasCorrectToolForDrops, hasInfiniteMaterials, hasPermissions, hurtArmor, hurtHelmet, hurtServer, increaseScore, interactOn, internalSetAbsorptionAmount, isAffectedByFluids, isAlwaysExperienceDropper, isAlwaysTicking, isClientAuthoritative, isCreative, isEffectiveAi, isHurt, isIgnoringFallDamageFromCurrentImpulse, isImmobile, isInvulnerableTo, isLocalClientAuthoritative, isModelPartShown, isPushedByFluid, isReducedDebugInfo, isScoping, isSecondaryUseActive, isSleepingLongEnough, isSpectator, isStayingOnGroundSurface, isSwimming, killedEntity, makeStuckInBlock, maybeBackOffFromEdge, mayBuild, mayUseItemAt, onAboveBubbleColumn, onClimbable, onEnchantmentPerformed, onInsideBubbleColumn, openHorseInventory, openMenu, playStepSound, preventsBlockDrops, readAdditionalSaveData, refreshDisplayName, remove, removeEntitiesOnShoulder, resetAttackStrengthTicker, resetCurrentImpulseContext, resetRecipes, resetStat, sendMerchantOffers, setClientLoaded, setEntityOnShoulder, setForcedPose, setIgnoreFallDamageFromCurrentImpulse, setLastDeathLocation, setMainArm, setReducedDebugInfo, setRemainingFireTicks, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldBeSaved, shouldShowName, startAutoSpinAttack, startFallFlying, startSleepInBed, stopSleepInBed, stopSleeping, sweepAttack, tickClientLoadTimeout, tickRegeneration, travel, triggerRecipeCrafted, tryResetCurrentImpulseContext, tryToStartFallFlying, updatePlayerPose, updateSwimming, wantsToStopRiding
Methods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, addEffect, addEffect, applyItemBlocking, areAllEffectsAmbient, attackable, baseTick, blockedByItem, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttackType, 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, dropFromGiftLootTable, dropFromLootTable, dropFromLootTable, dropFromShearingLootTable, equipmentHasChanged, forceAddEffect, getActiveEffects, getActiveEffectsMap, getAgeScale, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, 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, getLocalBoundsForPose, getLootTableSeed, getMainHandItem, getMaxAbsorption, getMaxFallDistance, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSecondsToDisableBlocking, getSleepingPos, getSlotForHand, getSoundVolume, getStingerCount, getSwimAmount, getTicksUsingItem, getUseItem, getUseItemRemainingTicks, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleExtraItemsCreatedOnUse, hasEffect, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, hasLineOfSight, igniteForTicks, increaseAirSupply, indicateDamage, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDeadOrDying, isEquippableInSlot, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInWall, isJumping, isLookingAtMe, isPickable, 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, playBlockFallSound, playHurtSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, resetForwardDirectionOfRelativePortalPosition, resolveMobResponsibleForDamage, resolvePlayerResponsibleForDamage, sanitizeScale, sendEffectToPassengers, serverAiStep, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setItemSlot, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSpeed, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, skipDropExperience, spawnItemParticles, startSleeping, stopFallFlying, stopRiding, swing, take, tickEffects, tickHeadTurn, tickRidden, travelFlying, travelFlying, triggerOnDeathMobEffects, tryAddFrost, updateEffectVisibility, updateFallFlying, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, wasExperienceConsumed, waypointIcon, wouldNotSuffocateAtTargetPose
Methods inherited from class net.minecraft.world.entity.Entity
absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canCollideWith, canControlVehicle, canRide, canTeleport, canTrample, captureDrops, captureDrops, castComponentValue, checkBelowWorld, checkDespawn, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, dropAllLeashConnections, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, 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, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, 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, getServer, getSharedFlag, getStringUUID, getTags, 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, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToLevel, isAffectedByBlocks, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isIgnoringBlockTriggers, isInClouds, isInFluidType, isInFluidType, isInLava, isInLiquid, 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, 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, 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, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, supportQuadLeashAsHolder, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, waterSwimSound
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, has
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.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, shouldRiderSit
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluid
Methods inherited from interface net.neoforged.neoforge.common.extensions.IPlayerExtension
isCloseEnough, isFakePlayer, mayFly, openMenu, openMenu
Methods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
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:
-
USING_ITEM_SPEED_FACTOR
public static final float USING_ITEM_SPEED_FACTOR- See Also:
-
connection
-
stats
-
recipeBook
-
dropSpamThrottler
-
ambientSoundHandlers
-
permissionLevel
private int permissionLevel -
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 -
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 pMinecraft, ClientLevel pLevel, ClientPacketListener pConnection, StatsCounter pStats, ClientRecipeBook pRecipeBook, Input pLastSentInput, boolean pWasSprinting)
-
-
Method Details
-
heal
public void heal(float pHealAmount) Heal living entity (param: amount of half-hearts)- Overrides:
heal
in classLivingEntity
-
startRiding
- Overrides:
startRiding
in classEntity
-
removeVehicle
public void removeVehicle()- Overrides:
removeVehicle
in classPlayer
-
getViewXRot
public float getViewXRot(float pPartialTick) Gets the current pitch of the entity.- Overrides:
getViewXRot
in classEntity
-
getViewYRot
public float getViewYRot(float pPartialTick) Gets the current yaw of the entity- Overrides:
getViewYRot
in classLivingEntity
-
tick
public void tick()- Overrides:
tick
in classAbstractClientPlayer
-
getCurrentMood
public float getCurrentMood() -
sendPosition
private void sendPosition() -
sendIsSprintingIfNeeded
private void sendIsSprintingIfNeeded() -
drop
public boolean drop(boolean pFullStack) -
swing
- Overrides:
swing
in classLivingEntity
-
respawn
public void respawn() -
closeContainer
public void closeContainer()- Overrides:
closeContainer
in classPlayer
-
clientSideCloseContainer
public void clientSideCloseContainer() -
hurtTo
public void hurtTo(float pHealth) Updates health locally. -
onUpdateAbilities
public void onUpdateAbilities()- Overrides:
onUpdateAbilities
in classPlayer
-
isLocalPlayer
public boolean isLocalPlayer()- Overrides:
isLocalPlayer
in classPlayer
-
isSuppressingSlidingDownLadder
public boolean isSuppressingSlidingDownLadder()- Overrides:
isSuppressingSlidingDownLadder
in classLivingEntity
-
canSpawnSprintParticle
public boolean canSpawnSprintParticle()- Overrides:
canSpawnSprintParticle
in classEntity
-
sendRidingJump
protected void sendRidingJump() -
sendOpenInventory
public void sendOpenInventory() -
getStats
-
getRecipeBook
-
removeRecipeHighlight
-
getPermissionLevel
public int getPermissionLevel()- Overrides:
getPermissionLevel
in classPlayer
-
setPermissionLevel
public void setPermissionLevel(int pPermissionLevel) -
displayClientMessage
- Overrides:
displayClientMessage
in classPlayer
-
moveTowardsClosestSpace
private void moveTowardsClosestSpace(double pX, double pZ) -
suffocatesAt
-
setExperienceValues
public void setExperienceValues(float pCurrentXP, int pMaxXP, int pLevel) Sets the current XP, total XP, and level number. -
handleEntityEvent
public void handleEntityEvent(byte pId) Handler forinvalid reference
World#setEntityState
- Overrides:
handleEntityEvent
in classPlayer
-
setShowDeathScreen
public void setShowDeathScreen(boolean pShow) -
shouldShowDeathScreen
public boolean shouldShowDeathScreen() -
setDoLimitedCrafting
public void setDoLimitedCrafting(boolean pDoLimitedCrafting) -
getDoLimitedCrafting
public boolean getDoLimitedCrafting() -
playSound
-
playNotifySound
- Overrides:
playNotifySound
in classPlayer
-
startUsingItem
- Overrides:
startUsingItem
in classLivingEntity
-
isUsingItem
public boolean isUsingItem()- Overrides:
isUsingItem
in classLivingEntity
-
stopUsingItem
public void stopUsingItem()- Overrides:
stopUsingItem
in classLivingEntity
-
getUsedItemHand
- Overrides:
getUsedItemHand
in classLivingEntity
-
onSyncedDataUpdated
- Specified by:
onSyncedDataUpdated
in interfaceSyncedDataHolder
- Overrides:
onSyncedDataUpdated
in classLivingEntity
-
jumpableVehicle
-
getJumpRidingScale
public float getJumpRidingScale() -
isTextFilteringEnabled
public boolean isTextFilteringEnabled()- Overrides:
isTextFilteringEnabled
in classPlayer
-
openTextEdit
- Overrides:
openTextEdit
in classPlayer
-
openMinecartCommandBlock
- Overrides:
openMinecartCommandBlock
in classPlayer
-
openCommandBlock
- Overrides:
openCommandBlock
in classPlayer
-
openStructureBlock
- Overrides:
openStructureBlock
in classPlayer
-
openTestBlock
- Overrides:
openTestBlock
in classPlayer
-
openTestInstanceBlock
- Overrides:
openTestInstanceBlock
in classPlayer
-
openJigsawBlock
- Overrides:
openJigsawBlock
in classPlayer
-
openDialog
- Overrides:
openDialog
in classPlayer
-
openItemGui
- Overrides:
openItemGui
in classPlayer
-
crit
Called when the entity is dealt a critical hit. -
magicCrit
-
isShiftKeyDown
public boolean isShiftKeyDown()- Overrides:
isShiftKeyDown
in classEntity
-
isCrouching
public boolean isCrouching()- Overrides:
isCrouching
in classEntity
-
isMovingSlowly
public boolean isMovingSlowly() -
applyInput
public void applyInput()- Overrides:
applyInput
in classLivingEntity
-
modifyInput
-
modifyInputSpeedForSquareMovement
-
distanceToUnitSquare
-
isControlledCamera
protected boolean isControlledCamera() -
resetPos
public void resetPos() -
aiStep
public void aiStep() -
shouldStopRunSprinting
private boolean shouldStopRunSprinting() -
shouldStopSwimSprinting
private boolean shouldStopSwimSprinting() -
hasBlindness
private boolean hasBlindness() -
getActivePortalLocalTransition
-
tickDeath
protected void tickDeath()- Overrides:
tickDeath
in classLivingEntity
-
handlePortalTransitionEffect
private void handlePortalTransitionEffect(boolean pInPortal) -
rideTick
public void rideTick() -
isHandsBusy
public boolean isHandsBusy() -
move
-
isAutoJumpEnabled
public boolean isAutoJumpEnabled() -
shouldRotateWithMinecart
public boolean shouldRotateWithMinecart()- Overrides:
shouldRotateWithMinecart
in classPlayer
-
updateAutoJump
protected void updateAutoJump(float pMovementX, float pMovementZ) -
isHorizontalCollisionMinor
- Overrides:
isHorizontalCollisionMinor
in classEntity
-
canAutoJump
private boolean canAutoJump() -
isMoving
private boolean isMoving() -
canStartSprinting
private boolean canStartSprinting() -
vehicleCanSprint
-
hasEnoughFoodToSprint
private boolean hasEnoughFoodToSprint() -
getWaterVision
public float getWaterVision() -
onGameModeChanged
-
isUnderWater
public boolean isUnderWater()- Overrides:
isUnderWater
in classEntity
-
updateIsUnderwater
protected boolean updateIsUnderwater()- Overrides:
updateIsUnderwater
in classPlayer
-
getRopeHoldPosition
- Overrides:
getRopeHoldPosition
in classPlayer
-
updateTutorialInventoryAction
public void updateTutorialInventoryAction(ItemStack pCarried, ItemStack pClicked, ClickAction pAction) - Overrides:
updateTutorialInventoryAction
in classPlayer
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Overrides:
getVisualRotationYInDegrees
in classLivingEntity
-
handleCreativeModeItemDrop
- Overrides:
handleCreativeModeItemDrop
in classPlayer
-
canDropItems
public boolean canDropItems()- Overrides:
canDropItems
in classPlayer
-
getDropSpamThrottler
-
getLastSentInput
-