public abstract class MobEntity extends LivingEntity
Entity.PositionUpdater
Modifier and Type | Field and Description |
---|---|
int |
ambientSoundChance |
protected float[] |
armorDropChances |
private DefaultedList<ItemStack> |
armorItems |
private BodyControl |
bodyControl |
protected int |
experiencePoints |
protected GoalSelector |
goalSelector |
protected float[] |
handDropChances |
private DefaultedList<ItemStack> |
handItems |
private Entity |
holdingEntity |
private int |
holdingEntityId |
protected JumpControl |
jumpControl |
private CompoundTag |
leashTag |
protected LookControl |
lookControl |
private Identifier |
lootTable |
private long |
lootTableSeed |
private static TrackedData<Byte> |
MOB_FLAGS |
protected MoveControl |
moveControl |
protected EntityNavigation |
navigation |
private Map<PathNodeType,Float> |
pathfindingPenalties |
private boolean |
persistent |
private boolean |
pickUpLoot |
private BlockPos |
positionTarget |
private float |
positionTargetRange |
private LivingEntity |
target |
protected GoalSelector |
targetSelector |
private MobVisibilityCache |
visibilityCache |
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, 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, yaw
DUMMY
Modifier | Constructor and Description |
---|---|
protected |
MobEntity(EntityType<? extends MobEntity> type,
World world) |
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canSee, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, damage, damageArmor, damageShield, deserializeBrain, destroy, displaySoulSpeedEffects, drop, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveEyeHeight, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getArrowType, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getBrain, getClimbingPos, getDamageTracker, getDeathSound, getDespawnCounter, getDimensions, getDrinkSound, getEatSound, getEyeHeight, getFallSound, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getHurtSound, 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, isBaby, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isImmobile, isInsideWall, isInSwimmingPose, isMobOrPlayer, isOnSoulSpeedBlock, isPushable, isSleeping, 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, onTrackedDataSet, 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, wakeUp
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, 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, getHeightOffset, 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, isInSneakingPose, 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_29919, 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, wouldPoseNotCollide
private static final TrackedData<Byte> MOB_FLAGS
public int ambientSoundChance
protected int experiencePoints
protected LookControl lookControl
protected MoveControl moveControl
protected JumpControl jumpControl
private final BodyControl bodyControl
protected EntityNavigation navigation
protected final GoalSelector goalSelector
protected final GoalSelector targetSelector
private LivingEntity target
private final MobVisibilityCache visibilityCache
private final DefaultedList<ItemStack> handItems
protected final float[] handDropChances
private final DefaultedList<ItemStack> armorItems
protected final float[] armorDropChances
private boolean pickUpLoot
private boolean persistent
private final Map<PathNodeType,Float> pathfindingPenalties
private Identifier lootTable
private long lootTableSeed
private int holdingEntityId
@Nullable private CompoundTag leashTag
private BlockPos positionTarget
private float positionTargetRange
protected MobEntity(EntityType<? extends MobEntity> type, World world)
protected void initGoals()
public static DefaultAttributeContainer.Builder createMobAttributes()
protected EntityNavigation createNavigation(World world)
protected boolean movesIndependently()
public float getPathfindingPenalty(PathNodeType nodeType)
public void setPathfindingPenalty(PathNodeType nodeType, float penalty)
public boolean method_29244(PathNodeType pathNodeType)
protected BodyControl createBodyControl()
public LookControl getLookControl()
public MoveControl getMoveControl()
public JumpControl getJumpControl()
public EntityNavigation getNavigation()
public MobVisibilityCache getVisibilityCache()
@Nullable public LivingEntity getTarget()
public void setTarget(@Nullable LivingEntity target)
public boolean canTarget(EntityType<?> type)
canTarget
in class LivingEntity
public boolean canUseRangedWeapon(RangedWeaponItem weapon)
public void onEatingGrass()
protected void initDataTracker()
initDataTracker
in class LivingEntity
public int getMinAmbientSoundDelay()
public void playAmbientSound()
public void baseTick()
baseTick
in class LivingEntity
protected void playHurtSound(DamageSource source)
playHurtSound
in class LivingEntity
private void resetSoundDelay()
protected int getCurrentExperience(PlayerEntity player)
getCurrentExperience
in class LivingEntity
public void playSpawnEffects()
@Environment(value=CLIENT) public void handleStatus(byte status)
handleStatus
in class LivingEntity
public void tick()
tick
in class LivingEntity
protected void updateGoalControls()
protected float turnHead(float bodyRotation, float headRotation)
turnHead
in class LivingEntity
@Nullable protected SoundEvent getAmbientSound()
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag
in class LivingEntity
public void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag
in class LivingEntity
protected void dropLoot(DamageSource source, boolean causedByPlayer)
dropLoot
in class LivingEntity
protected LootContext.Builder getLootContextBuilder(boolean causedByPlayer, DamageSource source)
getLootContextBuilder
in class LivingEntity
public final Identifier getLootTable()
getLootTable
in class LivingEntity
protected Identifier getLootTableId()
public void setForwardSpeed(float forwardSpeed)
public void setUpwardSpeed(float upwardSpeed)
public void setSidewaysSpeed(float sidewaysMovement)
public void setMovementSpeed(float movementSpeed)
setMovementSpeed
in class LivingEntity
public void tickMovement()
tickMovement
in class LivingEntity
protected void loot(ItemEntity item)
public boolean tryEquip(ItemStack equipment)
protected void equipLootStack(EquipmentSlot slot, ItemStack stack)
public void updateDropChances(EquipmentSlot slot)
public boolean prefersNewDamageableItem(ItemStack newStack, ItemStack oldStack)
public boolean canPickupItem(ItemStack stack)
public boolean canGather(ItemStack stack)
public boolean canImmediatelyDespawn(double distanceSquared)
public boolean cannotDespawn()
protected boolean isDisallowedInPeaceful()
public void checkDespawn()
checkDespawn
in class Entity
protected final void tickNewAi()
tickNewAi
in class LivingEntity
protected void sendAiDebugData()
protected void mobTick()
public int getLookPitchSpeed()
public int getBodyYawSpeed()
public int getLookYawSpeed()
public void lookAtEntity(Entity targetEntity, float maxYawChange, float maxPitchChange)
private float changeAngle(float oldAngle, float newAngle, float maxChangeInAngle)
public static boolean canMobSpawn(EntityType<? extends MobEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random)
public boolean canSpawn(WorldAccess world, SpawnReason spawnReason)
public boolean canSpawn(WorldView world)
public int getLimitPerChunk()
public boolean spawnsTooManyForEachTry(int count)
public int getSafeFallDistance()
getSafeFallDistance
in class Entity
public Iterable<ItemStack> getItemsHand()
getItemsHand
in class Entity
public Iterable<ItemStack> getArmorItems()
getArmorItems
in class LivingEntity
public ItemStack getEquippedStack(EquipmentSlot slot)
getEquippedStack
in class LivingEntity
public void equipStack(EquipmentSlot slot, ItemStack stack)
equipStack
in class LivingEntity
protected void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)
dropEquipment
in class LivingEntity
protected float getDropChance(EquipmentSlot slot)
protected void initEquipment(LocalDifficulty difficulty)
public static EquipmentSlot getPreferredEquipmentSlot(ItemStack stack)
@Nullable public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel)
protected void updateEnchantments(LocalDifficulty difficulty)
protected void method_30759(float float2)
protected void method_30758(float float2, EquipmentSlot equipmentSlot)
@Nullable public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)
public boolean canBeControlledByRider()
public void setPersistent()
public void setEquipmentDropChance(EquipmentSlot slot, float chance)
public boolean canPickUpLoot()
public void setCanPickUpLoot(boolean pickUpLoot)
public boolean canEquip(ItemStack stack)
canEquip
in class LivingEntity
public boolean isPersistent()
public final ActionResult interact(PlayerEntity player, Hand hand)
private ActionResult method_29506(PlayerEntity playerEntity, Hand hand)
protected void onPlayerSpawnedChild(PlayerEntity player, MobEntity child)
protected ActionResult interactMob(PlayerEntity player, Hand hand)
public boolean isInWalkTargetRange()
public boolean isInWalkTargetRange(BlockPos pos)
public void setPositionTarget(BlockPos target, int range)
public BlockPos getPositionTarget()
public float getPositionTargetRange()
public boolean hasPositionTarget()
@Nullable public <T extends MobEntity> T method_29243(EntityType<T> entityType, boolean bool)
protected void updateLeash()
public void detachLeash(boolean sendPacket, boolean dropItem)
public boolean canBeLeashedBy(PlayerEntity player)
public boolean isLeashed()
public void attachLeash(Entity entity, boolean sendPacket)
@Environment(value=CLIENT) public void setHoldingEntityId(int id)
public boolean startRiding(Entity entity, boolean force)
startRiding
in class Entity
private void deserializeLeashTag()
public boolean isLogicalSideForUpdatingMovement()
isLogicalSideForUpdatingMovement
in class Entity
public static boolean canEquipmentSlotContain(EquipmentSlot slot, ItemStack item)
public boolean canMoveVoluntarily()
canMoveVoluntarily
in class LivingEntity
public void setAiDisabled(boolean aiDisabled)
public void setLeftHanded(boolean leftHanded)
public void setAttacking(boolean attacking)
public boolean isAiDisabled()
public boolean isLeftHanded()
public boolean isAttacking()
public void setBaby(boolean baby)
public Arm getMainArm()
getMainArm
in class LivingEntity
public boolean canTarget(LivingEntity target)
canTarget
in class LivingEntity
public boolean tryAttack(Entity target)
tryAttack
in class LivingEntity
private void disablePlayerShield(PlayerEntity player, ItemStack mobStack, ItemStack playerStack)
protected boolean isAffectedByDaylight()
protected void swimUpward(Tag<Fluid> fluid)
swimUpward
in class LivingEntity
protected void method_30076()
method_30076
in class Entity