public class ServerPlayerEntity extends PlayerEntity implements ScreenHandlerListener
PlayerEntity.SleepFailureReasonEntity.PositionUpdaterabilities, 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, totalExperienceactiveItemStack, 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, upwardSpeedage, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, 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, yawDUMMY| Constructor and Description |
|---|
ServerPlayerEntity(MinecraftServer server,
ServerWorld world,
com.mojang.authlib.GameProfile profile,
ServerPlayerInteractionManager interactionManager) |
addExhaustion, addScore, addShoulderEntity, adjustMovementForSneaking, afterSpawn, applyDamage, attackLivingEntity, canClimb, canConsume, canEquip, canFly, canFoodHeal, canModifyBlocks, canPlaceOn, checkFallFlying, clipAtLedge, createPlayerAttributes, damageArmor, damageShield, disableShield, doesNotSuffocate, dropInventory, dropItem, dropSelectedItem, 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, handleStatus, increaseStat, increaseTravelMotionStats, incrementStat, incrementStat, initDataTracker, interact, isBlockBreakingRestricted, isCreativeLevelTwoOp, isImmobile, isMainPlayer, isOnSoulSpeedBlock, isPartVisible, isSleepingLongEnough, isSwimming, isUsingEffectiveTool, jump, method_29239, method_29500, method_29920, method_30951, onKilledOther, onSwimmingStart, openCommandBlockMinecartScreen, openJigsawScreen, openStructureBlockScreen, playSound, remove, requestRespawn, resetLastAttackedTicks, setAbsorptionAmount, setFireTicks, setMainArm, setReducedDebugInfo, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldAlwaysDropXp, shouldCancelInteraction, shouldDismount, shouldRenderName, slowMovement, spawnSweepAttackParticles, startFallFlying, stopFallFlying, takeShieldHit, tickMovement, tickNewAi, tickRiding, travel, updateSize, updateSwimming, updateWaterSubmersionState, vanishCursedItems, wakeUpaddSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyEnchantmentsToDamage, applyStatusEffect, baseTick, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canMoveVoluntarily, canSee, canTarget, canTarget, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, deserializeBrain, destroy, displaySoulSpeedEffects, drop, dropEquipment, dropLoot, dropXp, 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, markEffectsDirty, method_26317, method_26318, method_29242, method_29499, method_30633, method_31079, onAttacking, onEquipStack, onKilledBy, onTrackedDataSet, playBlockFallSound, playHurtSound, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendToolBreakStatus, setAttacker, setAttacking, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setMovementSpeed, setNearbySongPlaying, setOnGround, setRiptideTicks, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldDisplaySoulSpeedEffects, shouldDropLoot, spawnConsumptionEffects, stopUsingItem, swimUpward, swingHand, takeKnockback, teleport, tickCramming, tickHandSwing, tickRiptide, tickStatusEffects, tryAttack, turnHead, updatePostDeath, updateTrackedHeadRotation, updateTrackedPositionAndAnglesaddPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustSingleAxisMovementForCollisions, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, 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, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getStandingEyeHeight, getTargetingMargin, getTeamColorValue, 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_30632, method_30634, method_30950, method_31166, move, moveToBoundingBoxCenter, offsetX, offsetZ, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, playFlySound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, removeAllPassengers, removePassenger, removeScoreboardTag, 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, shouldSpawnSprintingParticles, shouldTrackOutput, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, toListTag, toListTag, toString, toTag, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollideprivate static final Logger LOGGER
public ServerPlayNetworkHandler networkHandler
public final MinecraftServer server
public final ServerPlayerInteractionManager interactionManager
private final PlayerAdvancementTracker advancementTracker
private final ServerStatHandler statHandler
private float lastHealthScore
private int lastFoodScore
private int lastAirScore
private int lastArmorScore
private int lastLevelScore
private int lastExperienceScore
private float syncedHealth
private int syncedFoodLevel
private boolean syncedSaturationIsZero
private int syncedExperience
private int joinInvulnerabilityTicks
private ChatVisibility clientChatVisibility
private boolean clientChatColorsEnabled
private long lastActionTime
private Entity cameraEntity
private boolean inTeleportationState
private boolean seenCredits
private final ServerRecipeBook recipeBook
private Vec3d levitationStartPos
private int levitationStartTick
private boolean disconnected
private ChunkSectionPos cameraPosition
private RegistryKey<World> spawnPointDimension
private boolean spawnPointSet
private float spawnAngle
@Nullable private final class_5513 field_26821
private int screenHandlerSyncId
public boolean skipPacketSlotUpdates
public int pingMilliseconds
public boolean notInAnyWorld
public ServerPlayerEntity(MinecraftServer server, ServerWorld world, com.mojang.authlib.GameProfile profile, ServerPlayerInteractionManager interactionManager)
private void moveToSpawn(ServerWorld world)
private int calculateSpawnOffsetMultiplier(int horizontalSpawnArea)
public void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag in class PlayerEntitypublic void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag in class PlayerEntitypublic void setExperiencePoints(int int2)
public void setExperienceLevel(int level)
public void addExperienceLevels(int levels)
addExperienceLevels in class PlayerEntitypublic void applyEnchantmentCosts(ItemStack enchantedItem, int experienceLevels)
applyEnchantmentCosts in class PlayerEntitypublic void onSpawn()
public void enterCombat()
enterCombat in class LivingEntitypublic void endCombat()
endCombat in class LivingEntityprotected void onBlockCollision(BlockState state)
onBlockCollision in class Entityprotected ItemCooldownManager createCooldownManager()
createCooldownManager in class PlayerEntitypublic void tick()
tick in class PlayerEntitypublic void playerTick()
private void updateScores(ScoreboardCriterion criterion, int score)
public void onDeath(DamageSource source)
onDeath in class PlayerEntityprivate void forgiveMobAnger()
public void updateKilledAdvancementCriterion(Entity killer, int score, DamageSource damageSource)
updateKilledAdvancementCriterion in class Entityprivate void updateScoreboardScore(String playerName, String team, ScoreboardCriterion[] scoreboardCriterion)
public boolean damage(DamageSource source, float amount)
damage in class PlayerEntitypublic boolean shouldDamagePlayer(PlayerEntity player)
shouldDamagePlayer in class PlayerEntityprivate boolean isPvpEnabled()
@Nullable protected TeleportTarget getTeleportTarget(ServerWorld destination)
getTeleportTarget in class Entity@Nullable public Entity moveToWorld(ServerWorld destination)
Note all entities except server player entities are completely recreated at the destination.
moveToWorld in class Entityprivate void createEndSpawnPlatform(ServerWorld world, BlockPos centerPos)
protected Optional<class_5459.class_5460> method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool)
method_30330 in class Entityprivate void worldChanged(ServerWorld origin)
public boolean canBeSpectated(ServerPlayerEntity spectator)
canBeSpectated in class Entityprivate void sendBlockEntityUpdate(BlockEntity blockEntity)
public void sendPickup(Entity item, int count)
sendPickup in class LivingEntitypublic com.mojang.datafixers.util.Either<PlayerEntity.SleepFailureReason,Unit> trySleep(BlockPos pos)
trySleep in class PlayerEntitypublic void sleep(BlockPos pos)
sleep in class LivingEntityprivate boolean isBedTooFarAway(BlockPos pos)
public void wakeUp(boolean bool,
boolean updateSleepingPlayers)
wakeUp in class PlayerEntitypublic boolean startRiding(Entity entity, boolean force)
startRiding in class Entitypublic void stopRiding()
stopRiding in class LivingEntitypublic boolean isInvulnerableTo(DamageSource damageSource)
isInvulnerableTo in class PlayerEntityprotected void fall(double heightDifference,
boolean onGround,
BlockState landedState,
BlockPos landedPosition)
fall in class LivingEntityprotected void applyMovementEffects(BlockPos pos)
applyMovementEffects in class LivingEntitypublic void handleFall(double heightDifference,
boolean onGround)
public void openEditSignScreen(SignBlockEntity sign)
openEditSignScreen in class PlayerEntityprivate void incrementScreenHandlerSyncId()
public OptionalInt openHandledScreen(@Nullable NamedScreenHandlerFactory factory)
openHandledScreen in class PlayerEntitypublic void sendTradeOffers(int syncId,
TradeOfferList offers,
int levelProgress,
int experience,
boolean leveled,
boolean refreshable)
sendTradeOffers in class PlayerEntitypublic void openHorseInventory(HorseBaseEntity horse, Inventory inventory)
openHorseInventory in class PlayerEntitypublic void openEditBookScreen(ItemStack book, Hand hand)
openEditBookScreen in class PlayerEntitypublic void openCommandBlockScreen(CommandBlockBlockEntity commandBlock)
openCommandBlockScreen in class PlayerEntitypublic void onSlotUpdate(ScreenHandler handler, int slotId, ItemStack stack)
onSlotUpdate in interface ScreenHandlerListenerpublic void refreshScreenHandler(ScreenHandler handler)
public void onHandlerRegistered(ScreenHandler handler, DefaultedList<ItemStack> stacks)
onHandlerRegistered in interface ScreenHandlerListenerpublic void onPropertyUpdate(ScreenHandler handler, int property, int value)
onPropertyUpdate in interface ScreenHandlerListenerpublic void closeHandledScreen()
closeHandledScreen in class PlayerEntitypublic void updateCursorStack()
public void closeCurrentScreen()
public void method_14218(float float2,
float float3,
boolean bool,
boolean bool2)
public void increaseStat(Stat<?> stat, int amount)
increaseStat in class PlayerEntitypublic void resetStat(Stat<?> stat)
resetStat in class PlayerEntitypublic int unlockRecipes(Collection<Recipe<?>> recipes)
unlockRecipes in class PlayerEntitypublic void unlockRecipes(Identifier[] ids)
unlockRecipes in class PlayerEntitypublic int lockRecipes(Collection<Recipe<?>> recipes)
lockRecipes in class PlayerEntitypublic void addExperience(int experience)
addExperience in class PlayerEntitypublic void onDisconnect()
public boolean isDisconnected()
public void markHealthDirty()
public void sendMessage(Text message, boolean actionBar)
sendMessage in class PlayerEntityprotected void consumeItem()
consumeItem in class LivingEntitypublic void lookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)
lookAt in class LivingEntitypublic void method_14222(EntityAnchorArgumentType.EntityAnchor entityAnchor, Entity entity, EntityAnchorArgumentType.EntityAnchor entityAnchor2)
public void copyFrom(ServerPlayerEntity oldPlayer, boolean alive)
protected void onStatusEffectApplied(StatusEffectInstance effect)
onStatusEffectApplied in class LivingEntityprotected void onStatusEffectUpgraded(StatusEffectInstance effect, boolean reapplyEffect)
onStatusEffectUpgraded in class LivingEntityprotected void onStatusEffectRemoved(StatusEffectInstance effect)
onStatusEffectRemoved in class LivingEntitypublic void requestTeleport(double destX,
double destY,
double destZ)
requestTeleport in class Entitypublic void refreshPositionAfterTeleport(double x,
double y,
double z)
refreshPositionAfterTeleport in class Entitypublic void addCritParticles(Entity target)
addCritParticles in class PlayerEntitypublic void addEnchantedHitParticles(Entity target)
addEnchantedHitParticles in class PlayerEntitypublic void sendAbilitiesUpdate()
sendAbilitiesUpdate in class PlayerEntitypublic ServerWorld getServerWorld()
public void setGameMode(GameMode gameMode)
setGameMode in class PlayerEntitypublic boolean isSpectator()
isSpectator in class PlayerEntitypublic boolean isCreative()
isCreative in class PlayerEntitypublic void sendSystemMessage(Text message, UUID senderUuid)
sendSystemMessage in interface CommandOutputsendSystemMessage in class Entitypublic void sendMessage(Text message, MessageType type, UUID senderUuid)
public String getIp()
public void setClientSettings(ClientSettingsC2SPacket packet)
public ChatVisibility getClientChatVisibility()
protected int getPermissionLevel()
getPermissionLevel in class Entitypublic void updateLastActionTime()
public ServerStatHandler getStatHandler()
public ServerRecipeBook getRecipeBook()
public void onStoppedTracking(Entity entity)
public void onStartedTracking(Entity entity)
protected void updatePotionVisibility()
updatePotionVisibility in class LivingEntitypublic Entity getCameraEntity()
public void setCameraEntity(Entity entity)
protected void tickNetherPortalCooldown()
tickNetherPortalCooldown in class Entitypublic void attack(Entity target)
attack in class PlayerEntitypublic long getLastActionTime()
public void swingHand(Hand hand)
swingHand in class LivingEntitypublic boolean isInTeleportationState()
public void onTeleportationDone()
public PlayerAdvancementTracker getAdvancementTracker()
public void teleport(ServerWorld targetWorld, double x, double y, double z, float yaw, float pitch)
public float getSpawnAngle()
public RegistryKey<World> getSpawnPointDimension()
public boolean isSpawnPointSet()
public void setSpawnPoint(RegistryKey<World> dimension, @Nullable BlockPos pos, float angle, boolean spawnPointSet, boolean bool)
public void sendInitialChunkPackets(ChunkPos chunkPos, Packet<?> packet, Packet<?> packet2)
public void sendUnloadChunkPacket(ChunkPos chunkPos)
public ChunkSectionPos getCameraPosition()
public void setCameraPosition(ChunkSectionPos cameraPosition)
public void playSound(SoundEvent event, SoundCategory category, float volume, float pitch)
playSound in class PlayerEntitypublic Packet<?> createSpawnPacket()
createSpawnPacket in class LivingEntitypublic ItemEntity dropItem(ItemStack stack, boolean throwRandomly, boolean retainOwnership)
dropItem in class PlayerEntitythrowRandomly - If true, the item will be thrown in a random direction from the entity regardless of which direction the entity is facing@Nullable public class_5513 method_31273()