@Environment(value=CLIENT) public class ClientPlayerEntity extends AbstractClientPlayerEntity
PlayerEntity.SleepFailureReason
Entity.PositionUpdater
clientWorld, elytraPitch, elytraRoll, elytraYaw
abilities, abilityResyncCountdown, capeX, capeY, capeZ, currentScreenHandler, enchantmentTableSeed, enderChestInventory, experienceLevel, experiencePickUpDelay, experienceProgress, field_7509, fishHook, hungerManager, inventory, isSubmergedInWater, LEFT_SHOULDER_ENTITY, MAIN_ARM, PLAYER_MODEL_PARTS, playerScreenHandler, prevCapeX, prevCapeY, prevCapeZ, prevStrideDistance, RIGHT_SHOULDER_ENTITY, STANDING_DIMENSIONS, strideDistance, totalExperience
activeItemStack, attackingPlayer, bodyTrackingIncrements, bodyYaw, brain, dead, deathTime, defaultMaxHealth, despawnCounter, field_6215, flyingSpeed, forwardSpeed, handSwinging, handSwingProgress, handSwingTicks, headTrackingIncrements, headYaw, hurtTime, itemUseTimeLeft, jumping, knockbackVelocity, lastAttackedTicks, lastDamageTaken, lastHandSwingProgress, lastLimbDistance, limbAngle, limbDistance, LIVING_FLAGS, lookDirection, maxHurtTime, playerHitTimer, preferredHand, prevBodyYaw, prevHeadYaw, prevLookDirection, prevStepBobbingAmount, randomLargeSeed, randomSmallSeed, riptideTicks, roll, scoreAmount, serverHeadYaw, serverPitch, serverX, serverY, serverYaw, serverZ, sidewaysSpeed, SLEEPING_DIMENSIONS, stepBobbingAmount, stuckArrowTimer, stuckStingerTimer, upwardSpeed
age, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yaw
DUMMY
Constructor and Description |
---|
ClientPlayerEntity(MinecraftClient client,
ClientWorld world,
ClientPlayNetworkHandler networkHandler,
StatHandler stats,
ClientRecipeBook recipeBook,
boolean lastSneaking,
boolean lastSprinting) |
Modifier and Type | Method and Description |
---|---|
void |
addCritParticles(Entity target) |
void |
addEnchantedHitParticles(Entity target) |
protected void |
applyDamage(DamageSource source,
float amount) |
protected void |
autoJump(float dx,
float dz) |
boolean |
canMoveVoluntarily() |
void |
clearActiveItem() |
void |
closeHandledScreen() |
void |
closeScreen() |
boolean |
damage(DamageSource source,
float amount) |
boolean |
dropSelectedItem(boolean dropEntireStack) |
Hand |
getActiveHand() |
float |
getMoodPercentage()
Returns the percentage for the biome mood sound for the debug HUD to
display.
|
protected int |
getPermissionLevel() |
float |
getPitch(float tickDelta) |
ClientRecipeBook |
getRecipeBook() |
String |
getServerBrand() |
StatHandler |
getStatHandler() |
float |
getUnderwaterVisibility()
Returns the color multiplier of vision in water, so that visibility in
water is reduced when the player just entered water.
|
float |
getYaw(float tickDelta) |
void |
handleStatus(byte status) |
boolean |
hasJumpingMount() |
private boolean |
hasMovementInput()
Returns whether the player has movement input.
|
void |
heal(float amount) |
boolean |
isAutoJumpEnabled() |
protected boolean |
isCamera() |
boolean |
isHoldingOntoLadder() |
boolean |
isInSneakingPose()
Returns whether the entity is in a crouching pose.
|
boolean |
isMainPlayer() |
boolean |
isRiding() |
boolean |
isSneaking() |
boolean |
isSubmergedInWater()
Returns whether this entity's hitbox is fully submerged in water.
|
boolean |
isUsingItem() |
private boolean |
isWalking() |
void |
method_29239() |
Vec3d |
method_30951(float float2) |
float |
method_3151() |
void |
move(MovementType type,
Vec3d movement) |
void |
onRecipeDisplayed(Recipe<?> recipe) |
void |
onTrackedDataSet(TrackedData<?> data) |
void |
openCommandBlockMinecartScreen(CommandBlockExecutor commandBlockExecutor) |
void |
openCommandBlockScreen(CommandBlockBlockEntity commandBlock) |
void |
openEditBookScreen(ItemStack book,
Hand hand) |
void |
openEditSignScreen(SignBlockEntity sign) |
void |
openJigsawScreen(JigsawBlockEntity jigsaw) |
void |
openRidingInventory() |
void |
openStructureBlockScreen(StructureBlockBlockEntity structureBlock) |
void |
playSound(SoundEvent sound,
float volume,
float pitch) |
void |
playSound(SoundEvent event,
SoundCategory category,
float volume,
float pitch) |
private void |
pushOutOfBlocks(double x,
double double2) |
StatusEffectInstance |
removeStatusEffectInternal(StatusEffect type)
Removes a status effect from this entity without calling any listener.
|
void |
requestRespawn() |
void |
sendAbilitiesUpdate() |
void |
sendChatMessage(String message) |
void |
sendMessage(Text message,
boolean actionBar) |
private void |
sendMovementPackets() |
void |
sendSystemMessage(Text message,
UUID senderUuid) |
void |
setClientPermissionLevel(int clientPermissionLevel) |
void |
setCurrentHand(Hand hand) |
void |
setExperience(float progress,
int total,
int level) |
void |
setServerBrand(String serverBrand) |
void |
setShowsDeathScreen(boolean shouldShow) |
void |
setSprinting(boolean sprinting) |
private boolean |
shouldAutoJump() |
boolean |
shouldDisplaySoulSpeedEffects() |
boolean |
shouldSlowDown() |
boolean |
shouldSpawnSprintingParticles() |
boolean |
showsDeathScreen() |
boolean |
startRiding(Entity entity,
boolean force) |
protected void |
startRidingJump() |
void |
swingHand(Hand hand) |
void |
tick() |
void |
tickMovement() |
void |
tickNewAi() |
void |
tickRiding() |
void |
updateHealth(float health) |
private void |
updateNausea() |
protected boolean |
updateWaterSubmersionState() |
private boolean |
wouldCollideAt(BlockPos blockPos) |
canRenderCapeTexture, canRenderElytraTexture, getCapeTexture, getElytraTexture, getModel, getPlayerListEntry, getSkinId, getSkinTexture, getSpeed, hasSkinTexture, isCreative, isSpectator, loadSkin
addExhaustion, addExperience, addExperienceLevels, addScore, addShoulderEntity, adjustMovementForSneaking, afterSpawn, applyEnchantmentCosts, attack, attackLivingEntity, canClimb, canConsume, canEquip, canFly, canFoodHeal, canModifyBlocks, canPlaceOn, checkFallFlying, clipAtLedge, createCooldownManager, createPlayerAttributes, damageArmor, damageShield, disableShield, doesNotSuffocate, dropInventory, dropItem, dropItem, dropShoulderEntities, eatFood, equip, equipStack, findRespawnPosition, getAbsorptionAmount, getActiveEyeHeight, getArmorItems, getArrowType, getAttackCooldownProgress, getAttackCooldownProgressPerTick, getBlockBreakingSpeed, getBurningDuration, getCurrentExperience, getDeathSound, getDefaultNetherPortalCooldown, getDimensions, getDisplayName, getEnchantmentTableSeed, getEnderChestInventory, getEntityName, getEquippedStack, getFallSound, getGameProfile, getHeightOffset, getHighSpeedSplashSound, getHungerManager, getHurtSound, getItemCooldownManager, getItemsHand, getLuck, getMainArm, getMaxNetherPortalTime, getMovementSpeed, getName, getNextLevelExperience, getOfflinePlayerUuid, getPoses, getReducedDebugInfo, getScore, getScoreboard, getShoulderEntityLeft, getShoulderEntityRight, getSleepTimer, getSoundCategory, getSplashSound, getSwimSound, getUuidFromProfile, getVelocityMultiplier, giveItemStack, handleFallDamage, increaseStat, increaseStat, increaseTravelMotionStats, incrementStat, incrementStat, initDataTracker, interact, isBlockBreakingRestricted, isCreativeLevelTwoOp, isImmobile, isInvulnerableTo, isOnSoulSpeedBlock, isPartVisible, isSleepingLongEnough, isSwimming, isUsingEffectiveTool, jump, lockRecipes, method_29500, method_29920, onDeath, onKilledOther, onSwimmingStart, openHandledScreen, openHorseInventory, readCustomDataFromTag, remove, resetLastAttackedTicks, resetStat, sendTradeOffers, setAbsorptionAmount, setFireTicks, setGameMode, setMainArm, setReducedDebugInfo, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldAlwaysDropXp, shouldCancelInteraction, shouldDamagePlayer, shouldDismount, shouldRenderName, slowMovement, spawnSweepAttackParticles, startFallFlying, stopFallFlying, takeShieldHit, travel, trySleep, unlockRecipes, unlockRecipes, updateSize, updateSwimming, vanishCursedItems, wakeUp, wakeUp, writeCustomDataToTag
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, baseTick, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canSee, canTarget, canTarget, canWalkOnFluid, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, deserializeBrain, destroy, displaySoulSpeedEffects, drop, dropEquipment, dropLoot, dropXp, endCombat, enterCombat, fall, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getBrain, getClimbingPos, getDamageTracker, getDespawnCounter, getDrinkSound, getEatSound, getEyeHeight, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getItemUseTime, getItemUseTimeLeft, getJumpVelocity, getLastAttackedTime, getLastAttackTime, getLeaningPitch, getLootContextBuilder, getLootTable, getMainHandStack, getMaxHealth, getNextAirOnLand, getNextAirUnderwater, getOffHandStack, getPrimeAdversary, getRandom, getRecentDamageSource, getRoll, getScaleFactor, getSleepingDirection, getSleepingPosition, getSoundPitch, getSoundVolume, getStackInHand, getStatusEffect, getStatusEffects, getStingerCount, getStuckArrowCount, getVisibilityBoundingBox, hasStackEquipped, hasStatusEffect, hurtByWater, isAffectedBySplashPotions, isAlive, isBaby, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isInsideWall, isInSwimmingPose, isMobOrPlayer, isPushable, isSleeping, isTarget, isUndead, isUsingRiptide, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_26317, method_26318, method_29242, method_29499, method_30633, method_31079, onAttacking, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, playBlockFallSound, playHurtSound, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAttacker, setAttacking, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setMovementSpeed, setNearbySongPlaying, setOnGround, setRiptideTicks, setSleepingPosition, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldDropLoot, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swimUpward, swingHand, takeKnockback, teleport, tickCramming, tickHandSwing, tickRiptide, tickStatusEffects, tryAttack, turnHead, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustSingleAxisMovementForCollisions, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeSpectated, canExplosionDestroyBlock, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, collidesWith, copyFrom, copyPositionAndRotation, dealDamage, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getEffectiveExplosionResistance, getEntityId, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeight, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMountedHeightOffset, getMovementDirection, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPistonBehavior, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getStandingEyeHeight, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getWidth, getX, getY, getZ, handleAttack, hasCustomName, hashCode, hasNetherPortalCooldown, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interact, interactAt, isAttackable, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isPartOf, isSilent, isSneaky, isSprinting, isSubmergedIn, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29241, method_29919, method_30076, method_30330, method_30632, method_30634, method_30950, method_31166, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, playFlySound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveSelfToTag, saveToTag, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFlag, setGlowing, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldTrackOutput, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
public final ClientPlayNetworkHandler networkHandler
private final StatHandler statHandler
private final ClientRecipeBook recipeBook
private final List<ClientPlayerTickable> tickables
private int clientPermissionLevel
private double lastX
private double lastBaseY
private double lastZ
private float lastYaw
private float lastPitch
private boolean lastOnGround
private boolean inSneakingPose
private boolean lastSneaking
private boolean lastSprinting
private int ticksSinceLastPositionPacketSent
private boolean healthInitialized
private String serverBrand
public Input input
protected final MinecraftClient client
protected int ticksLeftToDoubleTapSprint
public int ticksSinceSprintingChanged
public float renderYaw
public float renderPitch
public float lastRenderYaw
public float lastRenderPitch
private int field_3938
private float field_3922
public float nextNauseaStrength
public float lastNauseaStrength
private boolean usingItem
private Hand activeHand
private boolean riding
private boolean autoJumpEnabled
private int ticksToNextAutojump
private boolean field_3939
private int underwaterVisibilityTicks
private boolean showsDeathScreen
public ClientPlayerEntity(MinecraftClient client, ClientWorld world, ClientPlayNetworkHandler networkHandler, StatHandler stats, ClientRecipeBook recipeBook, boolean lastSneaking, boolean lastSprinting)
public boolean damage(DamageSource source, float amount)
damage
in class PlayerEntity
public void heal(float amount)
heal
in class LivingEntity
public boolean startRiding(Entity entity, boolean force)
startRiding
in class Entity
public void method_29239()
method_29239
in class PlayerEntity
public float getYaw(float tickDelta)
getYaw
in class LivingEntity
public void tick()
tick
in class PlayerEntity
public float getMoodPercentage()
private void sendMovementPackets()
public boolean dropSelectedItem(boolean dropEntireStack)
dropSelectedItem
in class PlayerEntity
public void sendChatMessage(String message)
public void swingHand(Hand hand)
swingHand
in class LivingEntity
public void requestRespawn()
requestRespawn
in class PlayerEntity
protected void applyDamage(DamageSource source, float amount)
applyDamage
in class PlayerEntity
public void closeHandledScreen()
closeHandledScreen
in class PlayerEntity
public void closeScreen()
public void updateHealth(float health)
public void sendAbilitiesUpdate()
sendAbilitiesUpdate
in class PlayerEntity
public boolean isMainPlayer()
isMainPlayer
in class PlayerEntity
public boolean isHoldingOntoLadder()
isHoldingOntoLadder
in class LivingEntity
true
if this entity should not lose height while in a climbing stateLivingEntity
public boolean shouldSpawnSprintingParticles()
shouldSpawnSprintingParticles
in class Entity
public boolean shouldDisplaySoulSpeedEffects()
shouldDisplaySoulSpeedEffects
in class LivingEntity
protected void startRidingJump()
public void openRidingInventory()
public void setServerBrand(String serverBrand)
public String getServerBrand()
public StatHandler getStatHandler()
public ClientRecipeBook getRecipeBook()
public void onRecipeDisplayed(Recipe<?> recipe)
protected int getPermissionLevel()
getPermissionLevel
in class Entity
public void setClientPermissionLevel(int clientPermissionLevel)
public void sendMessage(Text message, boolean actionBar)
sendMessage
in class PlayerEntity
private void pushOutOfBlocks(double x, double double2)
private boolean wouldCollideAt(BlockPos blockPos)
public void setSprinting(boolean sprinting)
setSprinting
in class LivingEntity
public void setExperience(float progress, int total, int level)
public void sendSystemMessage(Text message, UUID senderUuid)
sendSystemMessage
in interface CommandOutput
sendSystemMessage
in class Entity
public void handleStatus(byte status)
handleStatus
in class PlayerEntity
public void setShowsDeathScreen(boolean shouldShow)
public boolean showsDeathScreen()
public void playSound(SoundEvent sound, float volume, float pitch)
playSound
in class PlayerEntity
public void playSound(SoundEvent event, SoundCategory category, float volume, float pitch)
playSound
in class PlayerEntity
public boolean canMoveVoluntarily()
canMoveVoluntarily
in class LivingEntity
public void setCurrentHand(Hand hand)
setCurrentHand
in class LivingEntity
public boolean isUsingItem()
isUsingItem
in class LivingEntity
public void clearActiveItem()
clearActiveItem
in class LivingEntity
public Hand getActiveHand()
getActiveHand
in class LivingEntity
public void onTrackedDataSet(TrackedData<?> data)
onTrackedDataSet
in class LivingEntity
public boolean hasJumpingMount()
public float method_3151()
public void openEditSignScreen(SignBlockEntity sign)
openEditSignScreen
in class PlayerEntity
public void openCommandBlockMinecartScreen(CommandBlockExecutor commandBlockExecutor)
openCommandBlockMinecartScreen
in class PlayerEntity
public void openCommandBlockScreen(CommandBlockBlockEntity commandBlock)
openCommandBlockScreen
in class PlayerEntity
public void openStructureBlockScreen(StructureBlockBlockEntity structureBlock)
openStructureBlockScreen
in class PlayerEntity
public void openJigsawScreen(JigsawBlockEntity jigsaw)
openJigsawScreen
in class PlayerEntity
public void openEditBookScreen(ItemStack book, Hand hand)
openEditBookScreen
in class PlayerEntity
public void addCritParticles(Entity target)
addCritParticles
in class PlayerEntity
public void addEnchantedHitParticles(Entity target)
addEnchantedHitParticles
in class PlayerEntity
public boolean isSneaking()
isSneaking
in class Entity
public boolean isInSneakingPose()
Compared to isSneaking()
, it only makes the entity appear
crouching and does not bring other effects of sneaking, such as no less
obvious name label rendering, no dismounting while riding, etc.
This is used by vanilla for non-player entities to crouch, such as for foxes and cats.
isInSneakingPose
in class Entity
public boolean shouldSlowDown()
public void tickNewAi()
tickNewAi
in class PlayerEntity
protected boolean isCamera()
public void tickMovement()
tickMovement
in class PlayerEntity
private void updateNausea()
public void tickRiding()
tickRiding
in class PlayerEntity
public boolean isRiding()
@Nullable public StatusEffectInstance removeStatusEffectInternal(@Nullable StatusEffect type)
This method does not perform any cleanup or synchronization operation.
Under most circumstances, calling LivingEntity.removeStatusEffect(net.minecraft.entity.effect.StatusEffect)
is highly preferable.
removeStatusEffectInternal
in class LivingEntity
public void move(MovementType type, Vec3d movement)
public boolean isAutoJumpEnabled()
protected void autoJump(float dx, float dz)
private boolean shouldAutoJump()
private boolean hasMovementInput()
private boolean isWalking()
public float getUnderwaterVisibility()
public boolean isSubmergedInWater()
isSubmergedInWater
in class Entity
protected boolean updateWaterSubmersionState()
updateWaterSubmersionState
in class PlayerEntity
public Vec3d method_30951(float float2)
method_30951
in class PlayerEntity