public abstract class PlayerEntity extends LivingEntity
Modifier and Type | Class and Description |
---|---|
static class |
PlayerEntity.SleepFailureReason |
Entity.PositionUpdater
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 |
---|
PlayerEntity(World world,
BlockPos pos,
float yaw,
com.mojang.authlib.GameProfile profile) |
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, baseTick, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canMoveVoluntarily, canSee, canTarget, canTarget, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, deserializeBrain, destroy, displaySoulSpeedEffects, drop, dropEquipment, dropLoot, dropXp, endCombat, enterCombat, fall, getActiveHand, 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, getYaw, hasStackEquipped, hasStatusEffect, heal, hurtByWater, isAffectedBySplashPotions, isAlive, isBaby, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isInsideWall, isInSwimmingPose, isMobOrPlayer, isPushable, isSleeping, isTarget, isUndead, isUsingItem, isUsingRiptide, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_26317, method_26318, method_29242, method_29499, method_30633, method_31079, onAttacking, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, onTrackedDataSet, playBlockFallSound, playHurtSound, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAttacker, setAttacking, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setMovementSpeed, setNearbySongPlaying, setOnGround, setRiptideTicks, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldDisplaySoulSpeedEffects, shouldDropLoot, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swimUpward, swingHand, 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, getPermissionLevel, getPistonBehavior, getPitch, 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, isInSneakingPose, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isPartOf, isSilent, isSneaking, isSneaky, isSprinting, isSubmergedIn, isSubmergedInWater, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29241, method_29919, method_30076, method_30330, method_30632, method_30634, method_30950, method_31166, move, 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, sendSystemMessage, 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, shouldSpawnSprintingParticles, shouldTrackOutput, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
public static final EntityDimensions STANDING_DIMENSIONS
private static final Map<EntityPose,EntityDimensions> POSE_DIMENSIONS
private static final TrackedData<Float> ABSORPTION_AMOUNT
private static final TrackedData<Integer> SCORE
protected static final TrackedData<Byte> PLAYER_MODEL_PARTS
protected static final TrackedData<Byte> MAIN_ARM
protected static final TrackedData<CompoundTag> LEFT_SHOULDER_ENTITY
protected static final TrackedData<CompoundTag> RIGHT_SHOULDER_ENTITY
private long shoulderEntityAddedTime
public final PlayerInventory inventory
protected EnderChestInventory enderChestInventory
public final PlayerScreenHandler playerScreenHandler
public ScreenHandler currentScreenHandler
protected HungerManager hungerManager
protected int abilityResyncCountdown
public float prevStrideDistance
public float strideDistance
public int experiencePickUpDelay
public double prevCapeX
public double prevCapeY
public double prevCapeZ
public double capeX
public double capeY
public double capeZ
private int sleepTimer
protected boolean isSubmergedInWater
public final PlayerAbilities abilities
public int experienceLevel
public int totalExperience
public float experienceProgress
protected int enchantmentTableSeed
protected final float field_7509
private int lastPlayedLevelUpSoundTime
private final com.mojang.authlib.GameProfile gameProfile
@Environment(value=CLIENT) private boolean reducedDebugInfo
private ItemStack selectedItem
private final ItemCooldownManager itemCooldownManager
@Nullable public FishingBobberEntity fishHook
public boolean isBlockBreakingRestricted(World world, BlockPos pos, GameMode gameMode)
public static DefaultAttributeContainer.Builder createPlayerAttributes()
protected void initDataTracker()
initDataTracker
in class LivingEntity
public void tick()
tick
in class LivingEntity
public boolean shouldCancelInteraction()
protected boolean shouldDismount()
protected boolean clipAtLedge()
protected boolean updateWaterSubmersionState()
private void updateTurtleHelmet()
protected ItemCooldownManager createCooldownManager()
private void updateCapeAngles()
protected void updateSize()
public int getMaxNetherPortalTime()
getMaxNetherPortalTime
in class Entity
protected SoundEvent getSwimSound()
getSwimSound
in class Entity
protected SoundEvent getSplashSound()
getSplashSound
in class Entity
protected SoundEvent getHighSpeedSplashSound()
getHighSpeedSplashSound
in class Entity
public int getDefaultNetherPortalCooldown()
getDefaultNetherPortalCooldown
in class Entity
public void playSound(SoundEvent sound, float volume, float pitch)
public void playSound(SoundEvent event, SoundCategory category, float volume, float pitch)
public SoundCategory getSoundCategory()
getSoundCategory
in class Entity
protected int getBurningDuration()
getBurningDuration
in class Entity
@Environment(value=CLIENT) public void handleStatus(byte status)
handleStatus
in class LivingEntity
@Environment(value=CLIENT) private void spawnParticles(ParticleEffect parameters)
protected void closeHandledScreen()
public void tickRiding()
tickRiding
in class LivingEntity
@Environment(value=CLIENT) public void afterSpawn()
afterSpawn
in class Entity
protected void tickNewAi()
tickNewAi
in class LivingEntity
public void tickMovement()
tickMovement
in class LivingEntity
private void updateShoulderEntity(@Nullable CompoundTag compoundTag)
private void collideWithEntity(Entity entity)
public int getScore()
public void setScore(int score)
public void addScore(int score)
public void onDeath(DamageSource source)
onDeath
in class LivingEntity
protected void dropInventory()
dropInventory
in class LivingEntity
protected void vanishCursedItems()
protected SoundEvent getHurtSound(DamageSource source)
getHurtSound
in class LivingEntity
protected SoundEvent getDeathSound()
getDeathSound
in class LivingEntity
public boolean dropSelectedItem(boolean dropEntireStack)
@Nullable public ItemEntity dropItem(ItemStack stack, boolean retainOwnership)
@Nullable public ItemEntity dropItem(ItemStack stack, boolean throwRandomly, boolean retainOwnership)
throwRandomly
- If true, the item will be thrown in a random direction from the entity regardless of which direction the entity is facingpublic float getBlockBreakingSpeed(BlockState block)
public boolean isUsingEffectiveTool(BlockState block)
public void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag
in class LivingEntity
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag
in class LivingEntity
public boolean isInvulnerableTo(DamageSource damageSource)
isInvulnerableTo
in class Entity
public boolean damage(DamageSource source, float amount)
damage
in class LivingEntity
protected void takeShieldHit(LivingEntity attacker)
takeShieldHit
in class LivingEntity
public boolean shouldDamagePlayer(PlayerEntity player)
protected void damageArmor(DamageSource source, float amount)
damageArmor
in class LivingEntity
protected void damageShield(float amount)
damageShield
in class LivingEntity
protected void applyDamage(DamageSource source, float amount)
applyDamage
in class LivingEntity
protected boolean isOnSoulSpeedBlock()
isOnSoulSpeedBlock
in class LivingEntity
public void openEditSignScreen(SignBlockEntity sign)
public void openCommandBlockMinecartScreen(CommandBlockExecutor commandBlockExecutor)
public void openCommandBlockScreen(CommandBlockBlockEntity commandBlock)
public void openStructureBlockScreen(StructureBlockBlockEntity structureBlock)
public void openJigsawScreen(JigsawBlockEntity jigsaw)
public void openHorseInventory(HorseBaseEntity horse, Inventory inventory)
public OptionalInt openHandledScreen(@Nullable NamedScreenHandlerFactory factory)
public void sendTradeOffers(int syncId, TradeOfferList offers, int levelProgress, int experience, boolean leveled, boolean refreshable)
public ActionResult interact(Entity entity, Hand hand)
public double getHeightOffset()
getHeightOffset
in class Entity
public void method_29239()
method_29239
in class Entity
protected boolean isImmobile()
isImmobile
in class LivingEntity
public boolean method_29920()
method_29920
in class LivingEntity
protected Vec3d adjustMovementForSneaking(Vec3d movement, MovementType type)
adjustMovementForSneaking
in class Entity
private boolean method_30263()
public void attack(Entity target)
protected void attackLivingEntity(LivingEntity target)
attackLivingEntity
in class LivingEntity
public void disableShield(boolean sprinting)
public void addCritParticles(Entity target)
public void addEnchantedHitParticles(Entity target)
public void spawnSweepAttackParticles()
@Environment(value=CLIENT) public void requestRespawn()
public boolean isMainPlayer()
public com.mojang.authlib.GameProfile getGameProfile()
public com.mojang.datafixers.util.Either<PlayerEntity.SleepFailureReason,Unit> trySleep(BlockPos pos)
public void wakeUp(boolean bool, boolean updateSleepingPlayers)
public void wakeUp()
wakeUp
in class LivingEntity
public static Optional<Vec3d> findRespawnPosition(ServerWorld world, BlockPos pos, float float2, boolean bool, boolean bool2)
public boolean isSleepingLongEnough()
public int getSleepTimer()
public void sendMessage(Text message, boolean actionBar)
public void incrementStat(Identifier stat)
public void increaseStat(Identifier stat, int amount)
public void incrementStat(Stat<?> stat)
public void increaseStat(Stat<?> stat, int amount)
public void resetStat(Stat<?> stat)
public int unlockRecipes(Collection<Recipe<?>> recipes)
public void unlockRecipes(Identifier[] ids)
public int lockRecipes(Collection<Recipe<?>> recipes)
public void jump()
jump
in class LivingEntity
public void travel(Vec3d movementInput)
travel
in class LivingEntity
public void updateSwimming()
updateSwimming
in class Entity
protected boolean doesNotSuffocate(BlockPos pos)
public float getMovementSpeed()
getMovementSpeed
in class LivingEntity
public void increaseTravelMotionStats(double dx, double dy, double dz)
private void increaseRidingMotionStats(double dx, double dy, double dz)
public boolean handleFallDamage(float fallDistance, float damageMultiplier)
handleFallDamage
in class LivingEntity
public boolean checkFallFlying()
public void startFallFlying()
public void stopFallFlying()
protected void onSwimmingStart()
onSwimmingStart
in class Entity
protected SoundEvent getFallSound(int distance)
getFallSound
in class LivingEntity
public void onKilledOther(ServerWorld serverWorld, LivingEntity livingEntity)
onKilledOther
in class Entity
public void slowMovement(BlockState state, Vec3d multiplier)
slowMovement
in class Entity
public void addExperience(int experience)
public int getEnchantmentTableSeed()
public void applyEnchantmentCosts(ItemStack enchantedItem, int experienceLevels)
public void addExperienceLevels(int levels)
public int getNextLevelExperience()
public void addExhaustion(float exhaustion)
public HungerManager getHungerManager()
public boolean canConsume(boolean ignoreHunger)
public boolean canFoodHeal()
public boolean canModifyBlocks()
protected int getCurrentExperience(PlayerEntity player)
getCurrentExperience
in class LivingEntity
protected boolean shouldAlwaysDropXp()
shouldAlwaysDropXp
in class LivingEntity
@Environment(value=CLIENT) public boolean shouldRenderName()
shouldRenderName
in class LivingEntity
public void sendAbilitiesUpdate()
public void setGameMode(GameMode gameMode)
public Text getName()
public EnderChestInventory getEnderChestInventory()
public ItemStack getEquippedStack(EquipmentSlot slot)
getEquippedStack
in class LivingEntity
public void equipStack(EquipmentSlot slot, ItemStack stack)
equipStack
in class LivingEntity
public boolean giveItemStack(ItemStack stack)
public Iterable<ItemStack> getItemsHand()
getItemsHand
in class Entity
public Iterable<ItemStack> getArmorItems()
getArmorItems
in class LivingEntity
public boolean addShoulderEntity(CompoundTag tag)
protected void dropShoulderEntities()
private void dropShoulderEntity(CompoundTag entityNbt)
public abstract boolean isSpectator()
isSpectator
in class Entity
public boolean isSwimming()
isSwimming
in class Entity
public abstract boolean isCreative()
public Scoreboard getScoreboard()
public Text getDisplayName()
getDisplayName
in interface Nameable
getDisplayName
in class Entity
private MutableText addTellClickEvent(MutableText component)
public String getEntityName()
getEntityName
in class Entity
public float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
getActiveEyeHeight
in class LivingEntity
public void setAbsorptionAmount(float amount)
setAbsorptionAmount
in class LivingEntity
public float getAbsorptionAmount()
getAbsorptionAmount
in class LivingEntity
public static UUID getUuidFromProfile(com.mojang.authlib.GameProfile profile)
@Environment(value=CLIENT) public boolean isPartVisible(PlayerModelPart modelPart)
@Environment(value=CLIENT) public boolean getReducedDebugInfo()
@Environment(value=CLIENT) public void setReducedDebugInfo(boolean reducedDebugInfo)
public void setFireTicks(int ticks)
setFireTicks
in class Entity
public Arm getMainArm()
getMainArm
in class LivingEntity
public void setMainArm(Arm arm)
public CompoundTag getShoulderEntityLeft()
protected void setShoulderEntityLeft(CompoundTag entityTag)
public CompoundTag getShoulderEntityRight()
protected void setShoulderEntityRight(CompoundTag entityTag)
public float getAttackCooldownProgressPerTick()
public float getAttackCooldownProgress(float baseTime)
public void resetLastAttackedTicks()
public ItemCooldownManager getItemCooldownManager()
protected float getVelocityMultiplier()
getVelocityMultiplier
in class LivingEntity
public float getLuck()
public boolean isCreativeLevelTwoOp()
public boolean canEquip(ItemStack stack)
canEquip
in class LivingEntity
public EntityDimensions getDimensions(EntityPose pose)
getDimensions
in class LivingEntity
public ImmutableList<EntityPose> getPoses()
getPoses
in class LivingEntity
public ItemStack getArrowType(ItemStack stack)
getArrowType
in class LivingEntity
public ItemStack eatFood(World world, ItemStack stack)
eatFood
in class LivingEntity
protected boolean method_29500(BlockState blockState)
method_29500
in class LivingEntity
@Environment(value=CLIENT) public Vec3d method_30951(float float2)
method_30951
in class Entity