public class ServerPlayerEntity extends PlayerEntity implements ScreenHandlerListener
PlayerEntity.SleepFailureReason
Entity.PositionUpdater
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, 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 |
---|
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, wakeUp
addSoulSpeedBoostIfNeeded, 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, updateTrackedPositionAndAngles
addPassenger, 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, wouldPoseNotCollide
private 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 PlayerEntity
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag
in class PlayerEntity
public void setExperiencePoints(int int2)
public void setExperienceLevel(int level)
public void addExperienceLevels(int levels)
addExperienceLevels
in class PlayerEntity
public void applyEnchantmentCosts(ItemStack enchantedItem, int experienceLevels)
applyEnchantmentCosts
in class PlayerEntity
public void onSpawn()
public void enterCombat()
enterCombat
in class LivingEntity
public void endCombat()
endCombat
in class LivingEntity
protected void onBlockCollision(BlockState state)
onBlockCollision
in class Entity
protected ItemCooldownManager createCooldownManager()
createCooldownManager
in class PlayerEntity
public void tick()
tick
in class PlayerEntity
public void playerTick()
private void updateScores(ScoreboardCriterion criterion, int score)
public void onDeath(DamageSource source)
onDeath
in class PlayerEntity
private void forgiveMobAnger()
public void updateKilledAdvancementCriterion(Entity killer, int score, DamageSource damageSource)
updateKilledAdvancementCriterion
in class Entity
private void updateScoreboardScore(String playerName, String team, ScoreboardCriterion[] scoreboardCriterion)
public boolean damage(DamageSource source, float amount)
damage
in class PlayerEntity
public boolean shouldDamagePlayer(PlayerEntity player)
shouldDamagePlayer
in class PlayerEntity
private 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 Entity
private void createEndSpawnPlatform(ServerWorld world, BlockPos centerPos)
protected Optional<class_5459.class_5460> method_30330(ServerWorld serverWorld, BlockPos blockPos, boolean bool)
method_30330
in class Entity
private void worldChanged(ServerWorld origin)
public boolean canBeSpectated(ServerPlayerEntity spectator)
canBeSpectated
in class Entity
private void sendBlockEntityUpdate(BlockEntity blockEntity)
public void sendPickup(Entity item, int count)
sendPickup
in class LivingEntity
public com.mojang.datafixers.util.Either<PlayerEntity.SleepFailureReason,Unit> trySleep(BlockPos pos)
trySleep
in class PlayerEntity
public void sleep(BlockPos pos)
sleep
in class LivingEntity
private boolean isBedTooFarAway(BlockPos pos)
public void wakeUp(boolean bool, boolean updateSleepingPlayers)
wakeUp
in class PlayerEntity
public boolean startRiding(Entity entity, boolean force)
startRiding
in class Entity
public void stopRiding()
stopRiding
in class LivingEntity
public boolean isInvulnerableTo(DamageSource damageSource)
isInvulnerableTo
in class PlayerEntity
protected void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition)
fall
in class LivingEntity
protected void applyMovementEffects(BlockPos pos)
applyMovementEffects
in class LivingEntity
public void handleFall(double heightDifference, boolean onGround)
public void openEditSignScreen(SignBlockEntity sign)
openEditSignScreen
in class PlayerEntity
private void incrementScreenHandlerSyncId()
public OptionalInt openHandledScreen(@Nullable NamedScreenHandlerFactory factory)
openHandledScreen
in class PlayerEntity
public void sendTradeOffers(int syncId, TradeOfferList offers, int levelProgress, int experience, boolean leveled, boolean refreshable)
sendTradeOffers
in class PlayerEntity
public void openHorseInventory(HorseBaseEntity horse, Inventory inventory)
openHorseInventory
in class PlayerEntity
public void openEditBookScreen(ItemStack book, Hand hand)
openEditBookScreen
in class PlayerEntity
public void openCommandBlockScreen(CommandBlockBlockEntity commandBlock)
openCommandBlockScreen
in class PlayerEntity
public void onSlotUpdate(ScreenHandler handler, int slotId, ItemStack stack)
onSlotUpdate
in interface ScreenHandlerListener
public void refreshScreenHandler(ScreenHandler handler)
public void onHandlerRegistered(ScreenHandler handler, DefaultedList<ItemStack> stacks)
onHandlerRegistered
in interface ScreenHandlerListener
public void onPropertyUpdate(ScreenHandler handler, int property, int value)
onPropertyUpdate
in interface ScreenHandlerListener
public void closeHandledScreen()
closeHandledScreen
in class PlayerEntity
public 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 PlayerEntity
public void resetStat(Stat<?> stat)
resetStat
in class PlayerEntity
public int unlockRecipes(Collection<Recipe<?>> recipes)
unlockRecipes
in class PlayerEntity
public void unlockRecipes(Identifier[] ids)
unlockRecipes
in class PlayerEntity
public int lockRecipes(Collection<Recipe<?>> recipes)
lockRecipes
in class PlayerEntity
public void addExperience(int experience)
addExperience
in class PlayerEntity
public void onDisconnect()
public boolean isDisconnected()
public void markHealthDirty()
public void sendMessage(Text message, boolean actionBar)
sendMessage
in class PlayerEntity
protected void consumeItem()
consumeItem
in class LivingEntity
public void lookAt(EntityAnchorArgumentType.EntityAnchor anchorPoint, Vec3d target)
lookAt
in class LivingEntity
public 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 LivingEntity
protected void onStatusEffectUpgraded(StatusEffectInstance effect, boolean reapplyEffect)
onStatusEffectUpgraded
in class LivingEntity
protected void onStatusEffectRemoved(StatusEffectInstance effect)
onStatusEffectRemoved
in class LivingEntity
public void requestTeleport(double destX, double destY, double destZ)
requestTeleport
in class Entity
public void refreshPositionAfterTeleport(double x, double y, double z)
refreshPositionAfterTeleport
in class Entity
public void addCritParticles(Entity target)
addCritParticles
in class PlayerEntity
public void addEnchantedHitParticles(Entity target)
addEnchantedHitParticles
in class PlayerEntity
public void sendAbilitiesUpdate()
sendAbilitiesUpdate
in class PlayerEntity
public ServerWorld getServerWorld()
public void setGameMode(GameMode gameMode)
setGameMode
in class PlayerEntity
public boolean isSpectator()
isSpectator
in class PlayerEntity
public boolean isCreative()
isCreative
in class PlayerEntity
public void sendSystemMessage(Text message, UUID senderUuid)
sendSystemMessage
in interface CommandOutput
sendSystemMessage
in class Entity
public 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 Entity
public void updateLastActionTime()
public ServerStatHandler getStatHandler()
public ServerRecipeBook getRecipeBook()
public void onStoppedTracking(Entity entity)
public void onStartedTracking(Entity entity)
protected void updatePotionVisibility()
updatePotionVisibility
in class LivingEntity
public Entity getCameraEntity()
public void setCameraEntity(Entity entity)
protected void tickNetherPortalCooldown()
tickNetherPortalCooldown
in class Entity
public void attack(Entity target)
attack
in class PlayerEntity
public long getLastActionTime()
public void swingHand(Hand hand)
swingHand
in class LivingEntity
public 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 PlayerEntity
public Packet<?> createSpawnPacket()
createSpawnPacket
in class LivingEntity
public ItemEntity dropItem(ItemStack stack, boolean throwRandomly, boolean retainOwnership)
dropItem
in class PlayerEntity
throwRandomly
- 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()