Package net.minecraft.server.level
Class ServerPlayer
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.player.Player
net.minecraft.server.level.ServerPlayer
- All Implemented Interfaces:
CommandSource,SyncedDataHolder,Attackable,EntityAccess,Nameable,ScoreHolder,IAttachmentHolder,IEntityExtension,ILivingEntityExtension,IPlayerExtension,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
FakePlayer,GameTestPlayer
-
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 PlayerAdvancementsprivate booleanprivate Entityprivate booleanprivate RemoteChatSessionprivate ChatVisiblityprivate ChunkTrackingViewintprivate final ContainerListenerprivate final ContainerSynchronizerprivate static final AttributeModifierprivate static final AttributeModifierprivate booleanprivate Vec3private Vec3private static final intfinal ServerPlayerGameModeprivate booleanstatic final doubleprivate booleanprivate Stringprivate longprivate booleanprivate intprivate intprivate intprivate intprivate floatprivate intprivate SectionPosprivate intprivate intprivate floatprivate Vec3private intprivate static final org.slf4j.Loggerprivate static final intprivate static final intfinal Objectprivate BlockPosprivate final ServerRecipeBookprivate intprivate floatprivate ResourceKey<Level> private booleanprivate BlockPosprivate booleanfinal MinecraftServerprivate booleanprivate intprivate Vec3private final ServerStatsCounterprivate Componentprivate Componentprivate Componentprivate final TextFilterprivate booleanprivate WardenSpawnTrackerbooleanFields 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, ignoreFallDamageFromCurrentImpulse, 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, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, 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, isInsidePortal, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalEntrancePos, portalTime, 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
ConstructorsConstructorDescriptionServerPlayer(MinecraftServer p_254143_, ServerLevel p_254435_, com.mojang.authlib.GameProfile p_253651_, ClientInformation p_301997_) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate booleanacceptsSystemMessages(boolean p_240568_) voidaddAdditionalSaveData(CompoundTag p_9197_) booleanvoidvoidawardKillScore(Entity p_9050_, int p_9051_, DamageSource p_9052_) intawardRecipes(Collection<RecipeHolder<?>> p_9129_) voidawardRecipesByKey(List<ResourceLocation> p_312811_) voidprivate booleanbedBlocked(BlockPos p_9192_, Direction p_9193_) private booleanbedInRange(BlockPos p_9117_, Direction p_9118_) booleanbroadcastToPlayer(ServerPlayer p_9014_) private GameTypecalculateGameModeForNewPlayer(GameType p_143424_) booleanbooleancanHarmPlayer(Player p_9064_) changeDimension(ServerLevel p_9180_, ITeleporter teleporter) protected voidcheckFallDamage(double p_8976_, boolean p_8977_, BlockState p_8978_, BlockPos p_8979_) voidcheckMovementStatistics(double p_308996_, double p_309062_, double p_309170_) private voidcheckRidingStatistics(double p_308888_, double p_309131_, double p_308893_) voidvoidprotected voidcreateCommonSpawnInfo(ServerLevel p_294169_) private voidcreateEndPlatform(ServerLevel p_9007_, BlockPos p_9008_) protected ItemCooldownsvoidprivate static booleandidNotMove(double p_309023_, double p_309067_, double p_309143_) voiddie(DamageSource p_9035_) voidvoiddismountTo(double p_143389_, double p_143390_, double p_143391_) voiddisplayClientMessage(Component p_9154_, boolean p_9155_) voiddoCheckFallDamage(double p_289676_, double p_289671_, double p_289665_, boolean p_289696_) voidvoiddoTick()booleandrop(boolean p_182295_) protected PortalInfofindDimensionEntryPoint(ServerLevel p_8998_) private voidfudgeSpawnLocation(ServerLevel p_9202_) private intgetCoprime(int p_9238_) protected Optional<BlockUtil.FoundRectangle> getExitPortal(ServerLevel p_184131_, BlockPos p_184132_, boolean p_184133_, WorldBorder p_184134_) Returns the language last reported by the player as their local language.longprotected intfloatgetStats()voidgiveExperienceLevels(int p_9200_) voidgiveExperiencePoints(int p_9208_) private voidhandleTeamKill(ScoreHolder p_313693_, ScoreHolder p_313814_, ObjectiveCriteria[] p_9127_) voidbooleanbooleanhurt(DamageSource p_9037_, float p_9038_) voidindicateDamage(double p_270621_, double p_270478_) voidvoidinitMenu(AbstractContainerMenu p_143400_) booleanbooleanbooleanisInvulnerableTo(DamageSource p_9182_) private booleanprivate booleanisReachableBedBlock(BlockPos p_9223_) booleanbooleanbooleanvoidloadGameTypes(CompoundTag p_143428_) voidlookAt(EntityAnchorArgument.Anchor p_9108_, Entity p_9109_, EntityAnchorArgument.Anchor p_9110_) voidlookAt(EntityAnchorArgument.Anchor p_9112_, Vec3 p_9113_) voidbooleanmayInteract(Level p_143406_, BlockPos p_143407_) voidmoveTo(double p_9171_, double p_9172_, double p_9173_) voidprotected voidonChangedBlock(BlockPos p_9206_) protected voidonEffectAdded(MobEffectInstance p_143393_, Entity p_143394_) protected voidonEffectRemoved(MobEffectInstance p_9184_) protected voidonEffectUpdated(MobEffectInstance p_143396_, boolean p_143397_, Entity p_143398_) voidonEnchantmentPerformed(ItemStack p_9079_, int p_9080_) voidvoidonExplosionHit(Entity p_326351_) protected voidonInsideBlock(BlockState p_9103_) voidonItemPickup(ItemEntity p_215095_) voidvoidvoidopenCommandBlock(CommandBlockEntity p_9099_) voidopenHorseInventory(AbstractHorse p_9059_, Container p_9060_) voidopenItemGui(ItemStack p_9082_, InteractionHand p_9083_) openMenu(MenuProvider p_9033_) openMenu(MenuProvider p_9033_, Consumer<RegistryFriendlyByteBuf> extraDataWriter) Request to open a GUI on the client, from the servervoidopenTextEdit(SignBlockEntity p_277909_, boolean p_277495_) voidplayNotifySound(SoundEvent p_9019_, SoundSource p_9020_, float p_9021_, float p_9022_) protected voidprotected voidvoidreadAdditionalSaveData(CompoundTag p_9131_) private static GameTypereadPlayerMode(CompoundTag p_143414_, String p_143415_) voidForce the name displayed in the tab list to refresh, by firingPlayerEvent.TabListNameFormat.intvoidvoidintresetRecipes(Collection<RecipeHolder<?>> p_9195_) voidvoidvoidrestoreFrom(ServerPlayer p_9016_, boolean p_9017_) voidrideTick()voidsendChatMessage(OutgoingChatMessage p_249852_, boolean p_250110_, ChatType.Bound p_252108_) voidsendMerchantOffers(int p_8988_, MerchantOffers p_8989_, int p_8990_, int p_8991_, boolean p_8992_, boolean p_8993_) voidsendServerStatus(ServerStatus p_215110_) voidsendSystemMessage(Component p_215097_) voidsendSystemMessage(Component p_240560_, boolean p_240545_) voidvoidsetChatSession(RemoteChatSession p_254468_) voidsetChunkTrackingView(ChunkTrackingView p_296310_) voidsetExperienceLevels(int p_9175_) voidsetExperiencePoints(int p_8986_) booleansetGameMode(GameType p_143404_) voidsetLastSectionPos(SectionPos p_9120_) voidsetPlayerInput(float p_8981_, float p_8982_, boolean p_8983_, boolean p_8984_) voidsetRaidOmenPosition(BlockPos p_338782_) voidsetRespawnPosition(ResourceKey<Level> p_9159_, BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) voidsetServerLevel(ServerLevel p_284971_) voidsetSpawnExtraParticlesOnFall(boolean p_334029_) voidsetTabListFooter(Component footer) Set the tab list footer while preserving the header.voidsetTabListHeader(Component header) Set the tab list header while preserving the footer.voidsetTabListHeaderFooter(Component header, Component footer) Set the tab list header and footer at once.booleanshouldFilterMessageTo(ServerPlayer p_143422_) booleanstartRiding(Entity p_277395_, boolean p_278062_) com.mojang.datafixers.util.Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos p_9115_) voidstartSleeping(BlockPos p_9190_) voidvoidstopSleepInBed(boolean p_9165_, boolean p_9166_) private voidstoreGameTypes(CompoundTag p_143431_) voidswing(InteractionHand p_9031_) voidvoidteleportRelative(double p_251611_, double p_248861_, double p_252266_) voidteleportTo(double p_8969_, double p_8970_, double p_8971_) voidteleportTo(ServerLevel p_9000_, double p_9001_, double p_9002_, double p_9003_, float p_9004_, float p_9005_) booleanteleportTo(ServerLevel p_265564_, double p_265424_, double p_265680_, double p_265312_, Set<RelativeMovement> p_265192_, float p_265059_, float p_265266_) private voidvoidtick()voidvoidvoidprivate voidvoidtriggerRecipeCrafted(RecipeHolder<?> p_301156_, List<ItemStack> p_282336_) protected voidvoidupdateOptions(ClientInformation p_301998_) private voidprivate voidupdateScoreForCriteria(ObjectiveCriteria p_9105_, int p_9106_) protected voidupdateUsingItem(ItemStack p_143402_) Methods inherited from class net.minecraft.world.entity.player.Player
actuallyHurt, addItem, aiStep, animateHurt, awardStat, awardStat, awardStat, blockActionRestricted, blockInteractionRange, blockUsingShield, canBeHitByProjectile, canBeSeenAsEnemy, canEat, canInteractWithBlock, canInteractWithEntity, canInteractWithEntity, canPlayerFitWithinBlocksAndEntitiesWhen, canSprint, canTakeItem, canUseGameMasterBlocks, canUseSlot, causeFallDamage, causeFoodExhaustion, createAttributes, defineSynchedData, destroyVanishingCursedItems, disableShield, doAutoAttackOnTouch, doesEmitEquipEvent, doWaterSplashEffect, drop, dropEquipment, eat, entityInteractionRange, findRespawnPositionAndUseSpawnBlock, freeAt, getAbilities, getAbsorptionAmount, getArmorSlots, getAttackStrengthScale, getBlockSpeedFactor, getCooldowns, getCurrentItemAttackStrengthDelay, getDeathSound, getDefaultDimensions, getDestroySpeed, getDigSpeed, getDimensionChangingDelay, getDismountPoses, getDisplayName, getEnchantmentSeed, getEnderChestInventory, getExperienceReward, getFallSounds, getFireImmuneTicks, getFlyingSpeed, getFoodData, getForcedPose, getGameProfile, getHandSlots, getHurtDir, getHurtSound, getInventory, getItemBySlot, getLastDeathLocation, getLuck, getMainArm, getMaxHeadRotationRelativeToBody, getMovementEmission, getName, getPortalWaitTime, getPrefixes, getProjectile, getRopeHoldPosition, getScore, getScoreboard, getScoreboardName, getShoulderEntityLeft, getShoulderEntityRight, getSleepTimer, getSlot, getSoundSource, getSpeed, getSuffixes, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getXpNeededForNextLevel, handleEntityEvent, hasContainerOpen, hasCorrectToolForDrops, hasCorrectToolForDrops, hasInfiniteMaterials, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseScore, interactOn, internalSetAbsorptionAmount, isAffectedByFluids, isAlwaysExperienceDropper, isAlwaysTicking, isHurt, isImmobile, isLocalPlayer, isModelPartShown, isPushedByFluid, isReducedDebugInfo, isScoping, isSecondaryUseActive, isSleepingLongEnough, isStayingOnGroundSurface, isSwimming, jumpFromGround, killedEntity, makeStuckInBlock, maybeBackOffFromEdge, mayBuild, mayUseItemAt, onSoulSpeedBlock, openJigsawBlock, openMinecartCommandBlock, openStructureBlock, playSound, playStepSound, refreshDisplayName, remove, removeEntitiesOnShoulder, removeVehicle, resetAttackStrengthTicker, resetCurrentImpulseContext, respawn, serverAiStep, setEntityOnShoulder, setForcedPose, setItemSlot, setLastDeathLocation, setMainArm, setReducedDebugInfo, setRemainingFireTicks, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldBeSaved, shouldRemoveSoulSpeed, shouldShowName, startAutoSpinAttack, startFallFlying, stopFallFlying, stopSleeping, sweepAttack, tryToStartFallFlying, updateIsUnderwater, updatePlayerPose, updateSwimming, updateTutorialInventoryAction, wantsToStopRidingMethods inherited from class net.minecraft.world.entity.LivingEntity
addEffect, addEffect, areAllEffectsAmbient, attackable, baseTick, blockedByShield, brainProvider, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canAttackType, canBeAffected, canBeSeenByAnyone, canBreatheUnderwater, canChangeDimensions, canDisableShield, canFreeze, canSpawnSoulSpeedParticle, canStandOnFluid, checkAutoSpinAttack, clearSleepingPos, createLivingAttributes, createWitherRose, decreaseAirSupply, doHurtEquipment, doHurtTarget, doPush, dropAllDeathLoot, dropCustomDeathLoot, dropExperience, dropFromLootTable, equipmentHasChanged, forceAddEffect, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorAndBodyArmorSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBoundingBoxForCulling, getBrain, getCombatTracker, getComfortableFallDistance, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDefaultGravity, getDimensions, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getHitbox, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getLootTable, getLootTableSeed, getMainHandItem, getMaxAbsorption, getMaxFallDistance, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getRandom, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlotForHand, getSoundVolume, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, igniteForTicks, increaseAirSupply, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpInLiquid, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, makeBrain, makeSound, maxUpStep, onBelowWorld, onClimbable, onEquipItem, onSyncedDataUpdated, playBlockFallSound, playHurtSound, push, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeEffectsCuredBy, removeFrost, removeSoulSpeed, 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, spawnSoulSpeedParticle, startUsingItem, stopUsingItem, swing, tickDeath, tickEffects, tickHeadTurn, tickRidden, triggerItemUseEffects, tryAddFrost, tryAddSoulSpeed, updateEffectVisibility, updateSwingTime, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed, wouldNotSuffocateAtTargetPoseMethods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, applyGravity, blockPosition, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canCollideWith, canControlVehicle, canRide, canSpawnSprintParticle, canTrample, captureDrops, captureDrops, changeDimension, checkBelowWorld, checkDespawn, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, 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, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerClosestTo, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRotationVector, getSelfAndPassengers, getServer, getSharedFlag, getStringUUID, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isShiftKeyDown, isSilent, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isUnderWater, isVehicle, isVisuallyCrawling, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, markHurt, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onGround, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, pick, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, push, reapplyPosition, refreshDimensions, registryAccess, removeAfterChangingDimensions, removePassenger, removeTag, repositionEntityAfterLoad, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, 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, syncPacketPositionCodec, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, 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, hasData, removeData, setDataMethods 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, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, sendPairingData, serializeNBT, shouldRiderSitMethods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, self, sinkInFluidMethods inherited from interface net.neoforged.neoforge.common.extensions.IPlayerExtension
isCloseEnough, mayFly, openMenuMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ- See Also:
-
NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y- See Also:
-
FLY_STAT_RECORDING_SPEED
private static final int FLY_STAT_RECORDING_SPEED- See Also:
-
INTERACTION_DISTANCE_VERIFICATION_BUFFER
public static final double INTERACTION_DISTANCE_VERIFICATION_BUFFER- See Also:
-
CREATIVE_BLOCK_INTERACTION_RANGE_MODIFIER
-
CREATIVE_ENTITY_INTERACTION_RANGE_MODIFIER
-
connection
-
server
-
gameMode
-
advancements
-
stats
-
lastRecordedHealthAndAbsorption
private float lastRecordedHealthAndAbsorption -
lastRecordedFoodLevel
private int lastRecordedFoodLevel -
lastRecordedAirLevel
private int lastRecordedAirLevel -
lastRecordedArmor
private int lastRecordedArmor -
lastRecordedLevel
private int lastRecordedLevel -
lastRecordedExperience
private int lastRecordedExperience -
lastSentHealth
private float lastSentHealth -
lastSentFood
private int lastSentFood -
lastFoodSaturationZero
private boolean lastFoodSaturationZero -
lastSentExp
private int lastSentExp -
spawnInvulnerableTime
private int spawnInvulnerableTime -
chatVisibility
-
canChatColor
private boolean canChatColor -
lastActionTime
private long lastActionTime -
camera
-
isChangingDimension
private boolean isChangingDimension -
seenCredits
private boolean seenCredits -
recipeBook
-
levitationStartPos
-
levitationStartTime
private int levitationStartTime -
disconnected
private boolean disconnected -
requestedViewDistance
private int requestedViewDistance -
language
-
startingToFallPosition
-
enteredNetherPosition
-
enteredLavaOnVehiclePosition
-
lastSectionPos
-
chunkTrackingView
-
respawnDimension
-
respawnPosition
-
respawnForced
private boolean respawnForced -
respawnAngle
private float respawnAngle -
textFilter
-
textFilteringEnabled
private boolean textFilteringEnabled -
allowsListing
private boolean allowsListing -
spawnExtraParticlesOnFall
private boolean spawnExtraParticlesOnFall -
wardenSpawnTracker
-
raidOmenPosition
-
containerSynchronizer
-
containerListener
-
chatSession
-
object
-
containerCounter
public int containerCounter -
wonGame
public boolean wonGame -
tabListHeader
-
hasTabListName
private boolean hasTabListName -
tabListDisplayName
-
-
Constructor Details
-
ServerPlayer
public ServerPlayer(MinecraftServer p_254143_, ServerLevel p_254435_, com.mojang.authlib.GameProfile p_253651_, ClientInformation p_301997_)
-
-
Method Details
-
fudgeSpawnLocation
-
getCoprime
private int getCoprime(int p_9238_) -
readAdditionalSaveData
- Overrides:
readAdditionalSaveDatain classPlayer
-
addAdditionalSaveData
- Overrides:
addAdditionalSaveDatain classPlayer
-
setExperiencePoints
public void setExperiencePoints(int p_8986_) -
setExperienceLevels
public void setExperienceLevels(int p_9175_) -
giveExperienceLevels
public void giveExperienceLevels(int p_9200_) - Overrides:
giveExperienceLevelsin classPlayer
-
onEnchantmentPerformed
- Overrides:
onEnchantmentPerformedin classPlayer
-
initMenu
-
initInventoryMenu
public void initInventoryMenu() -
onEnterCombat
public void onEnterCombat()- Overrides:
onEnterCombatin classLivingEntity
-
onLeaveCombat
public void onLeaveCombat()- Overrides:
onLeaveCombatin classLivingEntity
-
onInsideBlock
- Overrides:
onInsideBlockin classEntity
-
createItemCooldowns
- Overrides:
createItemCooldownsin classPlayer
-
tick
public void tick() -
updatePlayerAttributes
private void updatePlayerAttributes() -
doTick
public void doTick() -
resetFallDistance
public void resetFallDistance()- Overrides:
resetFallDistancein classEntity
-
trackStartFallingPosition
public void trackStartFallingPosition() -
trackEnteredOrExitedLavaOnVehicle
public void trackEnteredOrExitedLavaOnVehicle() -
updateScoreForCriteria
-
die
-
tellNeutralMobsThatIDied
private void tellNeutralMobsThatIDied() -
awardKillScore
- Overrides:
awardKillScorein classEntity
-
handleTeamKill
private void handleTeamKill(ScoreHolder p_313693_, ScoreHolder p_313814_, ObjectiveCriteria[] p_9127_) -
hurt
-
canHarmPlayer
- Overrides:
canHarmPlayerin classPlayer
-
isPvpAllowed
private boolean isPvpAllowed() -
findDimensionEntryPoint
- Overrides:
findDimensionEntryPointin classEntity
-
changeDimension
- Overrides:
changeDimensionin classEntity
-
createEndPlatform
-
getExitPortal
protected Optional<BlockUtil.FoundRectangle> getExitPortal(ServerLevel p_184131_, BlockPos p_184132_, boolean p_184133_, WorldBorder p_184134_) - Overrides:
getExitPortalin classEntity
-
triggerDimensionChangeTriggers
-
broadcastToPlayer
- Overrides:
broadcastToPlayerin classEntity
-
take
- Overrides:
takein classLivingEntity
-
startSleepInBed
public com.mojang.datafixers.util.Either<Player.BedSleepingProblem,Unit> startSleepInBed(BlockPos p_9115_) - Overrides:
startSleepInBedin classPlayer
-
startSleeping
- Overrides:
startSleepingin classLivingEntity
-
bedInRange
-
isReachableBedBlock
-
bedBlocked
-
stopSleepInBed
public void stopSleepInBed(boolean p_9165_, boolean p_9166_) - Overrides:
stopSleepInBedin classPlayer
-
dismountTo
public void dismountTo(double p_143389_, double p_143390_, double p_143391_) - Overrides:
dismountToin classEntity
-
isInvulnerableTo
- Overrides:
isInvulnerableToin classPlayer
-
checkFallDamage
protected void checkFallDamage(double p_8976_, boolean p_8977_, BlockState p_8978_, BlockPos p_8979_) - Overrides:
checkFallDamagein classLivingEntity
-
onChangedBlock
- Overrides:
onChangedBlockin classLivingEntity
-
doCheckFallDamage
public void doCheckFallDamage(double p_289676_, double p_289671_, double p_289665_, boolean p_289696_) -
onExplosionHit
- Overrides:
onExplosionHitin classEntity
-
pushEntities
protected void pushEntities()- Overrides:
pushEntitiesin classLivingEntity
-
openTextEdit
- Overrides:
openTextEditin classPlayer
-
nextContainerCounter
public void nextContainerCounter() -
openMenu
-
openMenu
public OptionalInt openMenu(@Nullable MenuProvider p_9033_, @Nullable Consumer<RegistryFriendlyByteBuf> extraDataWriter) Description copied from interface:IPlayerExtensionRequest to open a GUI on the client, from the serverRefer to
IMenuTypeExtension.create(IContainerFactory)for how to provide a function to consume these GUI requests on the client.The maximum size for #extraDataWriter is 32600 bytes.
- Parameters:
p_9033_- A supplier of container properties including the registry name of the containerextraDataWriter- Consumer to write any additional data the GUI needs- Returns:
- The window ID of the opened GUI, or empty if the GUI could not be opened
-
sendMerchantOffers
public void sendMerchantOffers(int p_8988_, MerchantOffers p_8989_, int p_8990_, int p_8991_, boolean p_8992_, boolean p_8993_) - Overrides:
sendMerchantOffersin classPlayer
-
openHorseInventory
- Overrides:
openHorseInventoryin classPlayer
-
openItemGui
- Overrides:
openItemGuiin classPlayer
-
openCommandBlock
- Overrides:
openCommandBlockin classPlayer
-
closeContainer
public void closeContainer()- Overrides:
closeContainerin classPlayer
-
doCloseContainer
public void doCloseContainer()- Overrides:
doCloseContainerin classPlayer
-
setPlayerInput
public void setPlayerInput(float p_8981_, float p_8982_, boolean p_8983_, boolean p_8984_) -
travel
-
rideTick
public void rideTick() -
checkMovementStatistics
public void checkMovementStatistics(double p_308996_, double p_309062_, double p_309170_) -
checkRidingStatistics
private void checkRidingStatistics(double p_308888_, double p_309131_, double p_308893_) -
didNotMove
private static boolean didNotMove(double p_309023_, double p_309067_, double p_309143_) -
awardStat
-
resetStat
-
awardRecipes
- Overrides:
awardRecipesin classPlayer
-
triggerRecipeCrafted
- Overrides:
triggerRecipeCraftedin classPlayer
-
awardRecipesByKey
- Overrides:
awardRecipesByKeyin classPlayer
-
resetRecipes
- Overrides:
resetRecipesin classPlayer
-
giveExperiencePoints
public void giveExperiencePoints(int p_9208_) - Overrides:
giveExperiencePointsin classPlayer
-
disconnect
public void disconnect() -
hasDisconnected
public boolean hasDisconnected() -
resetSentInfo
public void resetSentInfo() -
displayClientMessage
- Overrides:
displayClientMessagein classPlayer
-
completeUsingItem
protected void completeUsingItem()- Overrides:
completeUsingItemin classLivingEntity
-
lookAt
- Overrides:
lookAtin classLivingEntity
-
lookAt
public void lookAt(EntityAnchorArgument.Anchor p_9108_, Entity p_9109_, EntityAnchorArgument.Anchor p_9110_) -
restoreFrom
-
onEffectAdded
- Overrides:
onEffectAddedin classLivingEntity
-
onEffectUpdated
protected void onEffectUpdated(MobEffectInstance p_143396_, boolean p_143397_, @Nullable Entity p_143398_) - Overrides:
onEffectUpdatedin classLivingEntity
-
onEffectRemoved
- Overrides:
onEffectRemovedin classLivingEntity
-
teleportTo
public void teleportTo(double p_8969_, double p_8970_, double p_8971_) - Overrides:
teleportToin classEntity
-
teleportRelative
public void teleportRelative(double p_251611_, double p_248861_, double p_252266_) - Overrides:
teleportRelativein classEntity
-
teleportTo
public boolean teleportTo(ServerLevel p_265564_, double p_265424_, double p_265680_, double p_265312_, Set<RelativeMovement> p_265192_, float p_265059_, float p_265266_) - Overrides:
teleportToin classEntity
-
moveTo
public void moveTo(double p_9171_, double p_9172_, double p_9173_) -
crit
-
magicCrit
-
onUpdateAbilities
public void onUpdateAbilities()- Overrides:
onUpdateAbilitiesin classPlayer
-
serverLevel
-
setGameMode
-
isSpectator
public boolean isSpectator()- Specified by:
isSpectatorin classPlayer
-
isCreative
public boolean isCreative()- Specified by:
isCreativein classPlayer
-
sendSystemMessage
- Specified by:
sendSystemMessagein interfaceCommandSource- Overrides:
sendSystemMessagein classEntity
-
sendSystemMessage
-
sendChatMessage
public void sendChatMessage(OutgoingChatMessage p_249852_, boolean p_250110_, ChatType.Bound p_252108_) -
getIpAddress
-
updateOptions
-
clientInformation
-
canChatInColor
public boolean canChatInColor() -
getChatVisibility
-
acceptsSystemMessages
private boolean acceptsSystemMessages(boolean p_240568_) -
acceptsChatMessages
private boolean acceptsChatMessages() -
requestedViewDistance
public int requestedViewDistance() -
sendServerStatus
-
getPermissionLevel
protected int getPermissionLevel()- Overrides:
getPermissionLevelin classEntity
-
resetLastActionTime
public void resetLastActionTime() -
getStats
-
getRecipeBook
-
updateInvisibilityStatus
protected void updateInvisibilityStatus()- Overrides:
updateInvisibilityStatusin classLivingEntity
-
getCamera
-
setCamera
-
processPortalCooldown
protected void processPortalCooldown()- Overrides:
processPortalCooldownin classEntity
-
attack
-
getLastActionTime
public long getLastActionTime() -
getTabListDisplayName
-
swing
- Overrides:
swingin classLivingEntity
-
isChangingDimension
public boolean isChangingDimension() -
hasChangedDimension
public void hasChangedDimension() -
getAdvancements
-
teleportTo
public void teleportTo(ServerLevel p_9000_, double p_9001_, double p_9002_, double p_9003_, float p_9004_, float p_9005_) -
getRespawnPosition
-
getRespawnAngle
public float getRespawnAngle() -
getRespawnDimension
-
isRespawnForced
public boolean isRespawnForced() -
setRespawnPosition
public void setRespawnPosition(ResourceKey<Level> p_9159_, @Nullable BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) -
getLastSectionPos
-
setLastSectionPos
-
getChunkTrackingView
-
setChunkTrackingView
-
playNotifySound
- Overrides:
playNotifySoundin classPlayer
-
drop
-
getLanguage
Returns the language last reported by the player as their local language. Defaults to en_us if the value is unknown. -
getTabListHeader
-
setTabListHeader
Set the tab list header while preserving the footer.- Parameters:
header- the new header, orComponent.empty()to clear
-
refreshTabListName
public void refreshTabListName()Force the name displayed in the tab list to refresh, by firingPlayerEvent.TabListNameFormat. -
getTextFilter
-
setServerLevel
-
readPlayerMode
-
calculateGameModeForNewPlayer
-
loadGameTypes
-
storeGameTypes
-
isTextFilteringEnabled
public boolean isTextFilteringEnabled()- Overrides:
isTextFilteringEnabledin classPlayer
-
shouldFilterMessageTo
-
mayInteract
- Overrides:
mayInteractin classEntity
-
updateUsingItem
- Overrides:
updateUsingItemin classLivingEntity
-
drop
public boolean drop(boolean p_182295_) -
allowsListing
public boolean allowsListing() -
getWardenSpawnTracker
- Overrides:
getWardenSpawnTrackerin classPlayer
-
setSpawnExtraParticlesOnFall
public void setSpawnExtraParticlesOnFall(boolean p_334029_) -
onItemPickup
- Overrides:
onItemPickupin classLivingEntity
-
setChatSession
-
getChatSession
-
indicateDamage
public void indicateDamage(double p_270621_, double p_270478_) - Overrides:
indicateDamagein classLivingEntity
-
startRiding
- Overrides:
startRidingin classEntity
-
stopRiding
public void stopRiding()- Overrides:
stopRidingin classLivingEntity
-
createCommonSpawnInfo
-
setRaidOmenPosition
-
clearRaidOmenPosition
public void clearRaidOmenPosition() -
getRaidOmenPosition
-