Package net.minecraft.entity.passive
Class FoxEntity
- All Implemented Interfaces:
class_5568,CommandOutput,Nameable
public class FoxEntity extends AnimalEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.passive.PassiveEntity
PassiveEntity.PassiveDataNested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater, Entity.RemovalReason -
Field Summary
Fields Modifier and Type Field Description private static Predicate<Entity>CHICKEN_AND_RABBIT_FILTERprivate inteatingTimeprivate floatextraRollingHeightprivate GoalfollowBabyTurtleGoalprivate GoalfollowChickenAndRabbitGoalprivate GoalfollowFishGoalprivate static TrackedData<Byte>FOX_FLAGSprivate floatheadRollProgressprivate static Predicate<Entity>JUST_ATTACKED_SOMETHING_FILTERprivate floatlastExtraRollingHeightprivate floatlastHeadRollProgressprivate static Predicate<Entity>NOTICEABLE_PLAYER_FILTERprivate static TrackedData<Optional<UUID>>OTHER_TRUSTEDprivate static TrackedData<Optional<UUID>>OWNERprivate static Predicate<ItemEntity>PICKABLE_DROP_FILTERprivate static TrackedData<Integer>TYPEFields inherited from class net.minecraft.entity.passive.PassiveEntity
breedingAge, forcedAge, happyTicksRemainingFields inherited from class net.minecraft.entity.mob.MobEntity
ambientSoundChance, armorDropChances, experiencePoints, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelectorFields inherited from class net.minecraft.entity.LivingEntity
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, upwardSpeedFields inherited from class net.minecraft.entity.Entity
age, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, inPowderSnow, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, ridingCooldown, stepHeight, submergedInWater, timeUntilRegen, touchingWater, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yawFields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Constructor Description FoxEntity(EntityType<? extends FoxEntity> type, World world) -
Method Summary
Modifier and Type Method Description private voidaddTrustedUuid(UUID uuid)private voidaddTypeSpecificGoals()private booleancanEat(ItemStack stack)booleancanEquip(ItemStack stack)static booleancanJumpChase(FoxEntity fox, LivingEntity chasedEntity)booleancanPickupItem(ItemStack stack)private booleancanTrust(UUID uuid)protected intcomputeFallDamage(float fallDistance, float damageMultiplier)FoxEntitycreateChild(ServerWorld serverWorld, PassiveEntity passiveEntity)static DefaultAttributeContainer.BuildercreateFoxAttributes()protected voiddrop(DamageSource source)private voiddropItem(ItemStack stack)protected voideat(PlayerEntity player, Hand hand, ItemStack itemStack)protected floatgetActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)protected SoundEventgetAmbientSound()floatgetBodyRotationHeightOffset(float tickDelta)protected SoundEventgetDeathSound()SoundEventgetEatSound(ItemStack stack)private booleangetFoxFlag(int bitmask)FoxEntity.TypegetFoxType()floatgetHeadRoll(float tickDelta)protected SoundEventgetHurtSound(DamageSource source)private List<UUID>getTrustedUuids()voidhandleStatus(byte status)protected voidinitDataTracker()protected voidinitEquipment(LocalDifficulty difficulty)protected voidinitGoals()EntityDatainitialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CompoundTag entityTag)private booleanisAggressive()booleanisBreedingItem(ItemStack stack)booleanisChasing()booleanisFullyCrouched()protected booleanisImmobile()booleanisInSneakingPose()Returns whether the entity is in a crouching pose.booleanisRollingHead()booleanisSitting()booleanisSleeping()booleanisWalking()protected voidloot(ItemEntity item)Vec3dmethod_29919()protected voidonPlayerSpawnedChild(PlayerEntity player, MobEntity child)voidplayAmbientSound()voidreadCustomDataFromTag(CompoundTag tag)private voidsetAggressive(boolean aggressive)voidsetChasing(boolean chasing)voidsetCrouching(boolean crouching)private voidsetFoxFlag(int mask, boolean value)voidsetRollingHead(boolean rollingHead)voidsetSitting(boolean sitting)private voidsetSleeping(boolean sleeping)voidsetTarget(LivingEntity target)private voidsetType(FoxEntity.Type type)private voidsetWalking(boolean walking)private voidspit(ItemStack stack)private voidstopActions()private voidstopSleeping()voidtick()voidtickMovement()private booleanwantsToPickupItem()voidwriteCustomDataToTag(CompoundTag tag)Methods inherited from class net.minecraft.entity.passive.AnimalEntity
breed, canBreedWith, canEat, canImmediatelyDespawn, damage, getCurrentExperience, getHeightOffset, getLoveTicks, getLovingPlayer, getMinAmbientSoundDelay, getPathfindingFavor, interactMob, isInLove, isValidNaturalSpawn, lovePlayer, mobTick, resetLoveTicks, setLoveTicksMethods inherited from class net.minecraft.entity.passive.PassiveEntity
getBreedingAge, growUp, growUp, isBaby, isReadyToBreed, onGrowUp, onTrackedDataSet, setBaby, setBreedingAgeMethods inherited from class net.minecraft.entity.mob.PathAwareEntity
canSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeashMethods inherited from class net.minecraft.entity.mob.MobEntity
attachLeash, baseTick, canBeControlledByRider, canBeLeashedBy, canGather, canMobSpawn, canMoveVoluntarily, cannotDespawn, canPickUpLoot, canSpawn, canTarget, canTarget, canUseRangedWeapon, checkDespawn, createBodyControl, createMobAttributes, createNavigation, detachLeash, dropEquipment, dropLoot, equipLootStack, equipStack, getArmorItems, getBodyYawSpeed, getDropChance, getEquipmentForSlot, getEquippedStack, getHoldingEntity, getItemsHand, getJumpControl, getLimitPerChunk, getLookControl, getLookPitchSpeed, getLookYawSpeed, getLootContextBuilder, getLootTable, getLootTableId, getMainArm, getMoveControl, getNavigation, getPathfindingPenalty, getPickBlockStack, getPositionTarget, getPositionTargetRange, getSafeFallDistance, getTarget, getVisibilityCache, hasPositionTarget, interact, isAffectedByDaylight, isAiDisabled, isAttacking, isDisallowedInPeaceful, isInWalkTargetRange, isInWalkTargetRange, isLeashed, isLeftHanded, isLogicalSideForUpdatingMovement, isPersistent, lookAtEntity, method_29243, method_29244, method_30076, method_30758, method_30759, method_33191, movesIndependently, onEatingGrass, playHurtSound, playSpawnEffects, prefersNewDamageableItem, prefersNewEquipment, sendAiDebugData, setAiDisabled, setAttacking, setCanPickUpLoot, setEquipmentDropChance, setForwardSpeed, setHoldingEntityId, setLeftHanded, setMovementSpeed, setPathfindingPenalty, setPersistent, setPositionTarget, setSidewaysSpeed, setUpwardSpeed, spawnsTooManyForEachTry, startRiding, swimUpward, tickNewAi, tryAttack, tryEquip, turnHead, updateDropChances, updateEnchantments, updateGoalControlsMethods inherited from class net.minecraft.entity.LivingEntity
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canFreeze, canHaveStatusEffect, canSee, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, damageArmor, damageShield, deserializeBrain, destroy, displaySoulSpeedEffects, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getArrowType, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getBrain, getClimbingPos, getDamageTracker, getDespawnCounter, getDimensions, getDrinkSound, getEyeHeight, getFallSound, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getItemUseTime, getItemUseTimeLeft, getJumpVelocity, getLastAttackedTime, getLastAttackTime, getLeaningPitch, getMainHandStack, getMaxHealth, getMovementSpeed, getNextAirOnLand, getNextAirUnderwater, getOffHandStack, getPoses, getPrimeAdversary, getRandom, getRecentDamageSource, getRoll, getScaleFactor, getSleepingDirection, getSleepingPosition, getSoundPitch, getSoundVolume, getStackInHand, getStatusEffect, getStatusEffects, getStingerCount, getStuckArrowCount, getVelocityMultiplier, getVisibilityBoundingBox, getYaw, handleFallDamage, hasStackEquipped, hasStatusEffect, heal, hurtByWater, isAffectedBySplashPotions, isAlive, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isInsideWall, isInSwimmingPose, isMobOrPlayer, isOnSoulSpeedBlock, isPushable, isTarget, isUndead, isUsingItem, isUsingRiptide, jump, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_26317, method_26318, method_29242, method_29500, method_30633, method_31079, method_32318, method_32324, method_32325, method_32326, method_33190, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, playBlockFallSound, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAbsorptionAmount, setAttacker, setAttacking, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setNearbySongPlaying, setOnGround, setRiptideTicks, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldAlwaysDropXp, shouldDisplaySoulSpeedEffects, shouldDropLoot, shouldRenderName, shouldSwimInFluids, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickRiptide, tickStatusEffects, travel, triggerItemPickedUpByEntityCriteria, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles, wakeUpMethods inherited from class net.minecraft.entity.Entity
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeSpectated, canClimb, canExplosionDestroyBlock, canFly, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, collidesWith, copyFrom, copyPositionAndRotation, dealDamage, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBlockX, getBlockY, getBlockZ, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getChunkPos, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getMinFreezeDamageTicks, getMountedHeightOffset, getMovementDirection, getName, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPistonBehavior, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStandingEyeHeight, getSwimSound, 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, interactAt, isAttackable, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isFreezing, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isOnFire, isOnGround, isPartOf, isPlayer, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29241, method_30330, method_30632, method_30634, method_30950, method_30951, method_31166, method_31473, method_31744, method_31746, method_31748, method_32875, method_32877, method_33189, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onSpawnPacket, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveSelfToTag, saveToTag, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setFrozenTicks, setGlowing, setInNetherPortal, setInPowderSnow, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, unsetRemoved, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
-
Field Details
-
TYPE
-
FOX_FLAGS
-
OWNER
-
OTHER_TRUSTED
-
PICKABLE_DROP_FILTER
-
JUST_ATTACKED_SOMETHING_FILTER
-
CHICKEN_AND_RABBIT_FILTER
-
NOTICEABLE_PLAYER_FILTER
-
followChickenAndRabbitGoal
-
followBabyTurtleGoal
-
followFishGoal
-
headRollProgress
private float headRollProgress -
lastHeadRollProgress
private float lastHeadRollProgress -
extraRollingHeight
private float extraRollingHeight -
lastExtraRollingHeight
private float lastExtraRollingHeight -
eatingTime
private int eatingTime
-
-
Constructor Details
-
FoxEntity
-
-
Method Details
-
initDataTracker
protected void initDataTracker()- Overrides:
initDataTrackerin classPassiveEntity
-
initGoals
protected void initGoals() -
getEatSound
- Overrides:
getEatSoundin classLivingEntity
-
tickMovement
public void tickMovement()- Overrides:
tickMovementin classAnimalEntity
-
isImmobile
protected boolean isImmobile()- Overrides:
isImmobilein classLivingEntity
-
canEat
-
initEquipment
- Overrides:
initEquipmentin classMobEntity
-
handleStatus
@Environment(CLIENT) public void handleStatus(byte status)- Overrides:
handleStatusin classAnimalEntity
-
createFoxAttributes
-
createChild
- Specified by:
createChildin classPassiveEntity
-
initialize
@Nullable public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)- Overrides:
initializein classPassiveEntity
-
addTypeSpecificGoals
private void addTypeSpecificGoals() -
eat
- Overrides:
eatin classAnimalEntity
-
getActiveEyeHeight
- Overrides:
getActiveEyeHeightin classLivingEntity
-
getFoxType
-
setType
-
getTrustedUuids
-
addTrustedUuid
-
writeCustomDataToTag
- Overrides:
writeCustomDataToTagin classAnimalEntity
-
readCustomDataFromTag
- Overrides:
readCustomDataFromTagin classAnimalEntity
-
isSitting
public boolean isSitting() -
setSitting
public void setSitting(boolean sitting) -
isWalking
public boolean isWalking() -
setWalking
private void setWalking(boolean walking) -
isAggressive
private boolean isAggressive() -
setAggressive
private void setAggressive(boolean aggressive) -
isSleeping
public boolean isSleeping()- Overrides:
isSleepingin classLivingEntity
-
setSleeping
private void setSleeping(boolean sleeping) -
setFoxFlag
private void setFoxFlag(int mask, boolean value) -
getFoxFlag
private boolean getFoxFlag(int bitmask) -
canEquip
-
canPickupItem
- Overrides:
canPickupItemin classMobEntity
-
spit
-
dropItem
-
loot
-
tick
public void tick() -
isBreedingItem
- Overrides:
isBreedingItemin classAnimalEntity
-
onPlayerSpawnedChild
- Overrides:
onPlayerSpawnedChildin classMobEntity
-
isChasing
public boolean isChasing() -
setChasing
public void setChasing(boolean chasing) -
isFullyCrouched
public boolean isFullyCrouched() -
setCrouching
public void setCrouching(boolean crouching) -
isInSneakingPose
public boolean isInSneakingPose()Returns whether the entity is in a crouching pose.Compared to
Entity.isSneaking(), it only makes the entity appear crouching and does not bring other effects of sneaking, such as no less obvious name label rendering, no dismounting while riding, etc.This is used by vanilla for non-player entities to crouch, such as for foxes and cats.
- Overrides:
isInSneakingPosein classEntity
-
setRollingHead
public void setRollingHead(boolean rollingHead) -
isRollingHead
public boolean isRollingHead() -
getHeadRoll
@Environment(CLIENT) public float getHeadRoll(float tickDelta) -
getBodyRotationHeightOffset
@Environment(CLIENT) public float getBodyRotationHeightOffset(float tickDelta) -
setTarget
-
computeFallDamage
protected int computeFallDamage(float fallDistance, float damageMultiplier)- Overrides:
computeFallDamagein classLivingEntity
-
stopSleeping
private void stopSleeping() -
stopActions
private void stopActions() -
wantsToPickupItem
private boolean wantsToPickupItem() -
playAmbientSound
public void playAmbientSound()- Overrides:
playAmbientSoundin classMobEntity
-
getAmbientSound
- Overrides:
getAmbientSoundin classMobEntity
-
getHurtSound
- Overrides:
getHurtSoundin classLivingEntity
-
getDeathSound
- Overrides:
getDeathSoundin classLivingEntity
-
canTrust
-
drop
- Overrides:
dropin classLivingEntity
-
canJumpChase
-
method_29919
- Overrides:
method_29919in classEntity
-