Package net.minecraft.client.player
Class LocalPlayer
- All Implemented Interfaces:
CommandSource,SyncedDataHolder,Attackable,EntityAccess,Nameable,ScoreHolder,IAttachmentHolder,IEntityExtension,ILivingEntityExtension,IPlayerExtension,INBTSerializable<CompoundTag>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.player.Player
Player.BedSleepingProblemNested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity
LivingEntity.FallsoundsNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AmbientSoundHandler> private booleanprivate intfinal ClientPacketListenerprivate booleanprivate booleanprivate booleanprivate booleanprivate floatprivate intprivate booleanstatic final org.slf4j.Loggerprotected final Minecraftprivate static final doublefloatprivate intprivate 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 booleanfloatprotected intprivate booleanprivate final StatsCounterprivate static final doubleprivate InteractionHandprivate booleanprivate 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 doubleThe last Y position which was transmitted to the server, used to determine when the Y position changes and needs to be re-transmittedprivate 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 net.minecraft.client.player.AbstractClientPlayer
clientLevel, deltaMovementOnPreviousTick, elytraRotX, elytraRotY, elytraRotZFields inherited from class net.minecraft.world.entity.player.Player
bob, 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, zCloakOFields inherited from class net.minecraft.world.entity.LivingEntity
animStep, animStepO, appliedScale, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, ATTRIBUTES_FIELD, autoSpinAttackDmg, autoSpinAttackItemStack, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, HAND_SLOTS, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYHeadRot, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, oRun, PLAYER_HURT_EXPERIENCE_TIME, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, timeOffs, USE_ITEM_INTERVAL, useItem, useItemRemaining, walkAnimation, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zzaFields 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, ID_TAG, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionLocalPlayer(Minecraft pMinecraft, ClientLevel pClientLevel, ClientPacketListener pConnection, StatsCounter pStats, ClientRecipeBook pRecipeBook, boolean pWasShiftKeyDown, boolean pWasSprinting) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactuallyHurt(DamageSource pDamageSrc, float pDamageAmount) Deals damage to the entity.voidaiStep()private booleanbooleanprivate booleanvoidvoidvoidCalled when the entity is dealt a critical hit.voiddisplayClientMessage(Component pChatComponent, boolean pActionBar) booleandrop(boolean pFullStack) floatbooleanfloatintgetRopeHoldPosition(float pPartialTick) getStats()floatgetViewXRot(float pPartialTick) Gets the current pitch of the entity.floatgetViewYRot(float pPartialTick) Gets the current yaw of the entityfloatfloatprivate voidhandleConfusionTransitionEffect(boolean pUseConfusion) voidhandleEntityEvent(byte pId) Handler forinvalid reference
World#setEntityStateprivate booleanprivate booleanvoidheal(float pHealAmount) Heal living entity (param: amount of half-hearts)booleanhurt(DamageSource pSource, float pAmount) Called when the entity is attacked.voidhurtTo(float pHealth) Updates health locally.booleanprotected booleanbooleanbooleanbooleanprotected booleanisHorizontalCollisionMinor(Vec3 pDeltaMovement) booleanprivate booleanisMoving()booleanbooleanbooleanbooleanbooleanbooleanvoidCalled when the entity hit is dealt extra melee damage due to an enchantment.voidprivate voidmoveTowardsClosestSpace(double pX, double pZ) voidonGameModeChanged(GameType pGameMode) voidonSyncedDataUpdated(EntityDataAccessor<?> pKey) voidvoidopenCommandBlock(CommandBlockEntity pCommandBlock) voidopenItemGui(ItemStack pStack, InteractionHand pHand) voidopenJigsawBlock(JigsawBlockEntity pJigsawBlockEntity) voidopenMinecartCommandBlock(BaseCommandBlock pCommandBlock) voidopenStructureBlock(StructureBlockEntity pStructure) voidopenTextEdit(SignBlockEntity pSignEntity, boolean pIsFrontText) voidplayNotifySound(SoundEvent pSound, SoundSource pSource, float pVolume, float pPitch) voidplaySound(SoundEvent pSound, float pVolume, float pPitch) removeEffectNoUpdate(Holder<MobEffect> pEffect) voidremoveRecipeHighlight(RecipeHolder<?> pRecipe) voidvoidresetPos()voidrespawn()voidrideTick()private voidvoidprivate voidprotected voidvoidsendSystemMessage(Component pComponent) voidvoidsetDoLimitedCrafting(boolean pDoLimitedCrafting) voidsetExperienceValues(float pCurrentXP, int pMaxXP, int pLevel) Sets the current XP, total XP, and level number.voidsetPermissionLevel(int pPermissionLevel) voidsetShowDeathScreen(boolean pShow) booleanbooleanstartRiding(Entity pEntity, boolean pForce) voidstartUsingItem(InteractionHand pHand) voidprivate booleansuffocatesAt(BlockPos pPos) voidswing(InteractionHand pHand) voidtick()protected voidprotected voidupdateAutoJump(float pMovementX, float pMovementZ) protected booleanvoidupdateTutorialInventoryAction(ItemStack pCarried, ItemStack pClicked, ClickAction pAction) private booleanvehicleCanSprint(Entity pVehicle) Methods inherited from class net.minecraft.client.player.AbstractClientPlayer
getDeltaMovementLerped, getFieldOfViewModifier, getPlayerInfo, getSkin, isCreative, isSpectatorMethods inherited from class net.minecraft.world.entity.player.Player
addAdditionalSaveData, addItem, animateHurt, attack, awardRecipes, awardRecipesByKey, awardStat, awardStat, awardStat, awardStat, blockActionRestricted, blockInteractionRange, blockUsingShield, canBeHitByProjectile, canBeSeenAsEnemy, canEat, canHarmPlayer, canInteractWithBlock, canInteractWithEntity, canInteractWithEntity, canPlayerFitWithinBlocksAndEntitiesWhen, canSprint, canTakeItem, canUseGameMasterBlocks, canUseSlot, causeFallDamage, causeFoodExhaustion, createAttributes, createItemCooldowns, defineSynchedData, destroyVanishingCursedItems, die, disableShield, doAutoAttackOnTouch, doCloseContainer, doesEmitEquipEvent, doWaterSplashEffect, drop, drop, dropEquipment, eat, entityInteractionRange, freeAt, getAbilities, getAbsorptionAmount, getArmorSlots, getAttackStrengthScale, getBaseExperienceReward, getBlockSpeedFactor, getCooldowns, getCurrentItemAttackStrengthDelay, getDeathSound, getDefaultDimensions, getDestroySpeed, getDigSpeed, getDimensionChangingDelay, getDismountPoses, getDisplayName, getEnchantedDamage, getEnchantmentSeed, getEnderChestInventory, getFallSounds, getFireImmuneTicks, getFlyingSpeed, getFoodData, getForcedPose, getGameProfile, getHandSlots, getHurtDir, getHurtSound, getInventory, getItemBySlot, 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, hasContainerOpen, hasCorrectToolForDrops, hasCorrectToolForDrops, hasInfiniteMaterials, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseScore, interactOn, internalSetAbsorptionAmount, isAffectedByFluids, isAlwaysExperienceDropper, isAlwaysTicking, isHurt, isIgnoringFallDamageFromCurrentImpulse, isImmobile, isInvulnerableTo, isModelPartShown, isPushedByFluid, isReducedDebugInfo, isScoping, isSecondaryUseActive, isSleepingLongEnough, isStayingOnGroundSurface, isSwimming, jumpFromGround, killedEntity, makeStuckInBlock, maybeBackOffFromEdge, mayBuild, mayUseItemAt, onEnchantmentPerformed, openHorseInventory, openMenu, playStepSound, readAdditionalSaveData, refreshDisplayName, remove, removeEntitiesOnShoulder, resetAttackStrengthTicker, resetCurrentImpulseContext, resetRecipes, resetStat, sendMerchantOffers, setEntityOnShoulder, setForcedPose, setIgnoreFallDamageFromCurrentImpulse, setItemSlot, setLastDeathLocation, setMainArm, setReducedDebugInfo, setRemainingFireTicks, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldBeSaved, shouldShowName, startAutoSpinAttack, startFallFlying, startSleepInBed, stopFallFlying, stopSleepInBed, stopSleeping, sweepAttack, travel, triggerRecipeCrafted, tryResetCurrentImpulseContext, tryToStartFallFlying, updatePlayerPose, updateSwimming, wantsToStopRidingMethods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, addEffect, addEffect, areAllEffectsAmbient, attackable, baseTick, blockedByShield, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canAttackType, canBeAffected, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, canUsePortal, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, doHurtEquipment, doHurtTarget, doPush, dropAllDeathLoot, dropCustomDeathLoot, dropExperience, dropFromLootTable, eat, equipmentHasChanged, forceAddEffect, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorAndBodyArmorSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBoundingBoxForCulling, getBrain, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDefaultGravity, getDimensions, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getExperienceReward, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getHitbox, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getKnockback, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getLootTable, getLootTableSeed, getMainHandItem, getMaxAbsorption, getMaxFallDistance, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlotForHand, getSoundVolume, getStingerCount, getSwimAmount, getTicksUsingItem, getUseItem, getUseItemRemainingTicks, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, igniteForTicks, increaseAirSupply, indicateDamage, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isVisuallySwimming, jumpInLiquid, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeBrain, makeSound, maxUpStep, onBelowWorld, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, playBlockFallSound, playHurtSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectParticles, removeEffectsCuredBy, removeFrost, resetForwardDirectionOfRelativePortalPosition, sanitizeScale, sendEffectToPassengers, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSpeed, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRiderFaceForward, skipDropExperience, startSleeping, stopRiding, swing, take, tickEffects, tickHeadTurn, tickRidden, triggerItemUseEffects, triggerOnDeathMobEffects, tryAddFrost, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed, wouldNotSuffocateAtTargetPoseMethods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyGravity, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canControlVehicle, canRide, canTrample, captureDrops, captureDrops, changeDimension, checkBelowWorld, checkDespawn, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, 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, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRotationVector, getSelfAndPassengers, getServer, getSharedFlag, getStringUUID, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToLevel, isAlliedTo, isAlliedTo, isAttackable, isColliding, isControlledByLocalInstance, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isSilent, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isVehicle, isVisuallyCrawling, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, markHurt, mayInteract, mirror, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, push, reapplyPosition, refreshDimensions, registryAccess, removeAfterChangingDimensions, removePassenger, removeTag, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncData, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, serializeNBT, shouldRiderSitMethods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface net.neoforged.neoforge.common.extensions.IPlayerExtension
isCloseEnough, isFakePlayer, mayFly, openMenu, openMenuMethods 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:
-
connection
-
stats
-
recipeBook
-
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 -
yLast1
private double yLast1The last Y position which was transmitted to the server, used to determine when the Y position changes and needs to be re-transmitted -
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 -
crouching
private boolean crouching -
wasShiftKeyDown
private boolean wasShiftKeyDown -
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
-
minecraft
-
sprintTriggerTime
protected int sprintTriggerTime -
yBob
public float yBob -
xBob
public float xBob -
yBobO
public float yBobO -
xBobO
public float xBobO -
jumpRidingTicks
private int jumpRidingTicks -
jumpRidingScale
private float jumpRidingScale -
spinningEffectIntensity
public float spinningEffectIntensity -
oSpinningEffectIntensity
public float oSpinningEffectIntensity -
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 pClientLevel, ClientPacketListener pConnection, StatsCounter pStats, ClientRecipeBook pRecipeBook, boolean pWasShiftKeyDown, boolean pWasSprinting)
-
-
Method Details
-
hurt
Called when the entity is attacked. -
heal
public void heal(float pHealAmount) 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 pPartialTick) Gets the current pitch of the entity.- Overrides:
getViewXRotin classEntity
-
getViewYRot
public float getViewYRot(float pPartialTick) 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 pFullStack) -
swing
- Overrides:
swingin classLivingEntity
-
respawn
public void respawn() -
actuallyHurt
Deals damage to the entity. This will take the armor of the entity into consideration before damaging the health bar.- Overrides:
actuallyHurtin classPlayer
-
closeContainer
public void closeContainer()- Overrides:
closeContainerin classPlayer
-
clientSideCloseContainer
public void clientSideCloseContainer() -
hurtTo
public void hurtTo(float pHealth) Updates health locally. -
onUpdateAbilities
public void onUpdateAbilities()- Overrides:
onUpdateAbilitiesin 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
-
getPermissionLevel
public int getPermissionLevel()- Overrides:
getPermissionLevelin classEntity
-
setPermissionLevel
public void setPermissionLevel(int pPermissionLevel) -
displayClientMessage
- Overrides:
displayClientMessagein 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. -
sendSystemMessage
- Specified by:
sendSystemMessagein interfaceCommandSource- Overrides:
sendSystemMessagein classEntity
-
handleEntityEvent
public void handleEntityEvent(byte pId) Handler forinvalid reference
World#setEntityState- Overrides:
handleEntityEventin classPlayer
-
setShowDeathScreen
public void setShowDeathScreen(boolean pShow) -
shouldShowDeathScreen
public boolean shouldShowDeathScreen() -
setDoLimitedCrafting
public void setDoLimitedCrafting(boolean pDoLimitedCrafting) -
getDoLimitedCrafting
public boolean getDoLimitedCrafting() -
playSound
-
playNotifySound
- Overrides:
playNotifySoundin classPlayer
-
isEffectiveAi
public boolean isEffectiveAi()- Overrides:
isEffectiveAiin classEntity
-
startUsingItem
- Overrides:
startUsingItemin classLivingEntity
-
isUsingItem
public boolean isUsingItem()- Overrides:
isUsingItemin classLivingEntity
-
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
-
openJigsawBlock
- Overrides:
openJigsawBlockin classPlayer
-
openItemGui
- Overrides:
openItemGuiin classPlayer
-
crit
Called when the entity is dealt a critical hit. -
magicCrit
Called when the entity hit is dealt extra melee damage due to an enchantment. -
isShiftKeyDown
public boolean isShiftKeyDown()- Overrides:
isShiftKeyDownin classEntity
-
isCrouching
public boolean isCrouching()- Overrides:
isCrouchingin classEntity
-
isMovingSlowly
public boolean isMovingSlowly() -
serverAiStep
public void serverAiStep()- Overrides:
serverAiStepin classPlayer
-
isControlledCamera
protected boolean isControlledCamera() -
resetPos
public void resetPos() -
aiStep
public void aiStep() -
getActivePortalLocalTransition
-
tickDeath
protected void tickDeath()- Overrides:
tickDeathin classLivingEntity
-
handleConfusionTransitionEffect
private void handleConfusionTransitionEffect(boolean pUseConfusion) -
rideTick
public void rideTick() -
isHandsBusy
public boolean isHandsBusy() -
removeEffectNoUpdate
- Overrides:
removeEffectNoUpdatein classLivingEntity
-
move
-
isAutoJumpEnabled
public boolean isAutoJumpEnabled() -
updateAutoJump
protected void updateAutoJump(float pMovementX, float pMovementZ) -
isHorizontalCollisionMinor
- Overrides:
isHorizontalCollisionMinorin classEntity
-
canAutoJump
private boolean canAutoJump() -
isMoving
private boolean isMoving() -
canStartSprinting
private boolean canStartSprinting() -
vehicleCanSprint
-
hasEnoughImpulseToStartSprinting
private boolean hasEnoughImpulseToStartSprinting() -
hasEnoughFoodToStartSprinting
private boolean hasEnoughFoodToStartSprinting() -
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 pCarried, ItemStack pClicked, ClickAction pAction) - Overrides:
updateTutorialInventoryActionin classPlayer
-
getVisualRotationYInDegrees
public float getVisualRotationYInDegrees()- Overrides:
getVisualRotationYInDegreesin classLivingEntity
-