public class FoxEntity extends AnimalEntity
PassiveEntity.PassiveDataEntity.PositionUpdater| Modifier and Type | Field and Description |
|---|---|
private static Predicate<Entity> |
CHICKEN_AND_RABBIT_FILTER |
private int |
eatingTime |
private float |
extraRollingHeight |
private Goal |
followBabyTurtleGoal |
private Goal |
followChickenAndRabbitGoal |
private Goal |
followFishGoal |
private static TrackedData<Byte> |
FOX_FLAGS |
private float |
headRollProgress |
private static Predicate<Entity> |
JUST_ATTACKED_SOMETHING_FILTER |
private float |
lastExtraRollingHeight |
private float |
lastHeadRollProgress |
private static Predicate<Entity> |
NOTICEABLE_PLAYER_FILTER |
private static TrackedData<Optional<UUID>> |
OTHER_TRUSTED |
private static TrackedData<Optional<UUID>> |
OWNER |
private static Predicate<ItemEntity> |
PICKABLE_DROP_FILTER |
private static TrackedData<Integer> |
TYPE |
breedingAge, forcedAge, happyTicksRemainingambientSoundChance, armorDropChances, experiencePoints, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelectoractiveItemStack, 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, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yawDUMMY| Constructor and Description |
|---|
FoxEntity(EntityType<? extends FoxEntity> type,
World world) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addTrustedUuid(UUID uuid) |
private void |
addTypeSpecificGoals() |
private boolean |
canEat(ItemStack stack) |
boolean |
canEquip(ItemStack stack) |
static boolean |
canJumpChase(FoxEntity fox,
LivingEntity chasedEntity) |
boolean |
canPickupItem(ItemStack stack) |
private boolean |
canTrust(UUID uuid) |
protected int |
computeFallDamage(float fallDistance,
float damageMultiplier) |
FoxEntity |
createChild(ServerWorld serverWorld,
PassiveEntity passiveEntity) |
static DefaultAttributeContainer.Builder |
createFoxAttributes() |
protected void |
drop(DamageSource source) |
private void |
dropItem(ItemStack stack) |
protected void |
eat(PlayerEntity player,
ItemStack stack) |
protected float |
getActiveEyeHeight(EntityPose pose,
EntityDimensions dimensions) |
protected SoundEvent |
getAmbientSound() |
float |
getBodyRotationHeightOffset(float tickDelta) |
protected SoundEvent |
getDeathSound() |
SoundEvent |
getEatSound(ItemStack stack) |
private boolean |
getFoxFlag(int bitmask) |
FoxEntity.Type |
getFoxType() |
float |
getHeadRoll(float tickDelta) |
protected SoundEvent |
getHurtSound(DamageSource source) |
private List<UUID> |
getTrustedUuids() |
void |
handleStatus(byte status) |
protected void |
initDataTracker() |
protected void |
initEquipment(LocalDifficulty difficulty) |
protected void |
initGoals() |
EntityData |
initialize(ServerWorldAccess world,
LocalDifficulty difficulty,
SpawnReason spawnReason,
EntityData entityData,
CompoundTag entityTag) |
private boolean |
isAggressive() |
boolean |
isBreedingItem(ItemStack stack) |
boolean |
isChasing() |
boolean |
isFullyCrouched() |
protected boolean |
isImmobile() |
boolean |
isInSneakingPose()
Returns whether the entity is in a crouching pose.
|
boolean |
isRollingHead() |
boolean |
isSitting() |
boolean |
isSleeping() |
boolean |
isWalking() |
protected void |
loot(ItemEntity item) |
Vec3d |
method_29919() |
protected void |
onPlayerSpawnedChild(PlayerEntity player,
MobEntity child) |
void |
playAmbientSound() |
void |
readCustomDataFromTag(CompoundTag tag) |
private void |
setAggressive(boolean aggressive) |
void |
setChasing(boolean chasing) |
void |
setCrouching(boolean crouching) |
private void |
setFoxFlag(int mask,
boolean value) |
void |
setRollingHead(boolean rollingHead) |
void |
setSitting(boolean sitting) |
private void |
setSleeping(boolean sleeping) |
void |
setTarget(LivingEntity target) |
private void |
setType(FoxEntity.Type type) |
private void |
setWalking(boolean walking) |
private void |
spit(ItemStack stack) |
private void |
stopActions() |
private void |
stopSleeping() |
void |
tick() |
void |
tickMovement() |
private boolean |
wantsToPickupItem() |
void |
writeCustomDataToTag(CompoundTag tag) |
breed, canBreedWith, canEat, canImmediatelyDespawn, damage, getCurrentExperience, getHeightOffset, getLoveTicks, getLovingPlayer, getMinAmbientSoundDelay, getPathfindingFavor, interactMob, isInLove, isValidNaturalSpawn, lovePlayer, mobTick, resetLoveTicks, setLoveTicksgetBreedingAge, growUp, growUp, isBaby, isReadyToBreed, onGrowUp, onTrackedDataSet, setBaby, setBreedingAgecanSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeashattachLeash, baseTick, canBeControlledByRider, canBeLeashedBy, canEquipmentSlotContain, canGather, canMobSpawn, canMoveVoluntarily, cannotDespawn, canPickUpLoot, canSpawn, canTarget, canTarget, canUseRangedWeapon, checkDespawn, createBodyControl, createMobAttributes, createNavigation, detachLeash, dropEquipment, dropLoot, equip, equipLootStack, equipStack, getArmorItems, getBodyYawSpeed, getDropChance, getEquipmentForSlot, getEquippedStack, getHoldingEntity, getItemsHand, getJumpControl, getLimitPerChunk, getLookControl, getLookPitchSpeed, getLookYawSpeed, getLootContextBuilder, getLootTable, getLootTableId, getMainArm, getMoveControl, getNavigation, getPathfindingPenalty, getPositionTarget, getPositionTargetRange, getPreferredEquipmentSlot, 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, 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, updateGoalControlsaddSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, 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_29499, method_29500, method_29920, method_30633, method_31079, 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, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickRiptide, tickStatusEffects, travel, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles, wakeUpaddPassenger, 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, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, 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, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isOnFire, isOnGround, isPartOf, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29239, method_29241, method_30330, method_30632, method_30634, method_30950, method_30951, method_31166, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, 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, 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, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollideprivate static final TrackedData<Integer> TYPE
private static final TrackedData<Byte> FOX_FLAGS
private static final TrackedData<Optional<UUID>> OWNER
private static final TrackedData<Optional<UUID>> OTHER_TRUSTED
private static final Predicate<ItemEntity> PICKABLE_DROP_FILTER
private static final Predicate<Entity> JUST_ATTACKED_SOMETHING_FILTER
private Goal followChickenAndRabbitGoal
private Goal followBabyTurtleGoal
private Goal followFishGoal
private float headRollProgress
private float lastHeadRollProgress
private float extraRollingHeight
private float lastExtraRollingHeight
private int eatingTime
public FoxEntity(EntityType<? extends FoxEntity> type, World world)
protected void initDataTracker()
initDataTracker in class PassiveEntitypublic SoundEvent getEatSound(ItemStack stack)
getEatSound in class LivingEntitypublic void tickMovement()
tickMovement in class AnimalEntityprotected boolean isImmobile()
isImmobile in class LivingEntityprivate boolean canEat(ItemStack stack)
protected void initEquipment(LocalDifficulty difficulty)
initEquipment in class MobEntity@Environment(value=CLIENT) public void handleStatus(byte status)
handleStatus in class AnimalEntitypublic static DefaultAttributeContainer.Builder createFoxAttributes()
public FoxEntity createChild(ServerWorld serverWorld, PassiveEntity passiveEntity)
createChild in class PassiveEntity@Nullable public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)
initialize in class PassiveEntityprivate void addTypeSpecificGoals()
protected void eat(PlayerEntity player, ItemStack stack)
eat in class AnimalEntityprotected float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
getActiveEyeHeight in class LivingEntitypublic FoxEntity.Type getFoxType()
private void setType(FoxEntity.Type type)
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag in class AnimalEntitypublic void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag in class AnimalEntitypublic boolean isSitting()
public void setSitting(boolean sitting)
public boolean isWalking()
private void setWalking(boolean walking)
private boolean isAggressive()
private void setAggressive(boolean aggressive)
public boolean isSleeping()
isSleeping in class LivingEntityprivate void setSleeping(boolean sleeping)
private void setFoxFlag(int mask,
boolean value)
private boolean getFoxFlag(int bitmask)
public boolean canPickupItem(ItemStack stack)
canPickupItem in class MobEntityprivate void spit(ItemStack stack)
private void dropItem(ItemStack stack)
protected void loot(ItemEntity item)
public boolean isBreedingItem(ItemStack stack)
isBreedingItem in class AnimalEntityprotected void onPlayerSpawnedChild(PlayerEntity player, MobEntity child)
onPlayerSpawnedChild in class MobEntitypublic boolean isChasing()
public void setChasing(boolean chasing)
public boolean isFullyCrouched()
public void setCrouching(boolean crouching)
public boolean isInSneakingPose()
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.
isInSneakingPose in class Entitypublic void setRollingHead(boolean rollingHead)
public boolean isRollingHead()
@Environment(value=CLIENT) public float getHeadRoll(float tickDelta)
@Environment(value=CLIENT) public float getBodyRotationHeightOffset(float tickDelta)
public void setTarget(@Nullable LivingEntity target)
protected int computeFallDamage(float fallDistance,
float damageMultiplier)
computeFallDamage in class LivingEntityprivate void stopSleeping()
private void stopActions()
private boolean wantsToPickupItem()
public void playAmbientSound()
playAmbientSound in class MobEntity@Nullable protected SoundEvent getAmbientSound()
getAmbientSound in class MobEntity@Nullable protected SoundEvent getHurtSound(DamageSource source)
getHurtSound in class LivingEntity@Nullable protected SoundEvent getDeathSound()
getDeathSound in class LivingEntityprivate boolean canTrust(UUID uuid)
protected void drop(DamageSource source)
drop in class LivingEntitypublic static boolean canJumpChase(FoxEntity fox, LivingEntity chasedEntity)
@Environment(value=CLIENT) public Vec3d method_29919()
method_29919 in class Entity