Package net.minecraft.world.entity
Class Mob
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.Mob
- All Implemented Interfaces:
CommandSource
,SyncedDataHolder
,Attackable
,EquipmentUser
,Leashable
,Targeting
,EntityAccess
,Nameable
,ScoreHolder
,IAttachmentHolder
,IEntityExtension
,ILivingEntityExtension
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
AmbientCreature
,EnderDragon
,FlyingMob
,PathfinderMob
,Slime
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity
LivingEntity.Fallsounds
Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
Nested classes/interfaces inherited from interface net.minecraft.world.entity.Leashable
Leashable.LeashData
-
Field Summary
Modifier and TypeFieldDescriptionint
protected final float[]
private final NonNullList
<ItemStack> protected float
private ItemStack
private final BodyRotationControl
private boolean
private static final EntityDataAccessor
<Byte> private static final double
static final float
final GoalSelector
protected final float[]
private final NonNullList
<ItemStack> private static final Vec3i
protected JumpControl
private Leashable.LeashData
protected LookControl
private ResourceKey
<LootTable> private long
static final float
static final float
static final float
static final float
private static final int
private static final int
private static final int
protected MoveControl
protected PathNavigation
private boolean
protected static final int
static final int
static final float
protected static final ResourceLocation
private BlockPos
private float
private final Sensing
private boolean
private MobSpawnType
private LivingEntity
final GoalSelector
static final int
protected int
Fields inherited from class net.minecraft.world.entity.LivingEntity
animStep, animStepO, appliedScale, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, ATTRIBUTES_FIELD, autoSpinAttackDmg, autoSpinAttackItemStack, 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, zza
Fields 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, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalProcess, 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, zOld
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
Fields inherited from interface net.minecraft.world.entity.Leashable
LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DIST
Fields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalSaveData
(CompoundTag p_21484_) void
aiStep()
void
ate()
void
baseTick()
boolean
canAttackType
(EntityType<?> p_21399_) boolean
boolean
canFireProjectileWeapon
(ProjectileWeaponItem p_21430_) boolean
canHoldItem
(ItemStack p_21545_) boolean
protected boolean
canReplaceCurrentItem
(ItemStack p_21428_, ItemStack p_21429_) boolean
canReplaceEqualItem
(ItemStack p_21478_, ItemStack p_21479_) boolean
canTakeItem
(ItemStack p_21522_) boolean
canUseSlot
(EquipmentSlot p_326379_) private InteractionResult
checkAndHandleImportantInteractions
(Player p_21500_, InteractionHand p_21501_) void
static boolean
checkMobSpawnRules
(EntityType<? extends Mob> p_217058_, LevelAccessor p_217059_, MobSpawnType p_217060_, BlockPos p_217061_, RandomSource p_217062_) boolean
checkSpawnObstruction
(LevelReader p_21433_) boolean
checkSpawnRules
(LevelAccessor p_21431_, MobSpawnType p_21432_) protected void
void
<T extends Mob>
TconvertTo
(EntityType<T> p_21407_, boolean p_21408_) protected BodyRotationControl
private LootParams
createEquipmentParams
(ServerLevel p_338758_) static AttributeSupplier.Builder
protected PathNavigation
createNavigation
(Level p_21480_) protected void
protected void
defineSynchedData
(SynchedEntityData.Builder p_326499_) boolean
doHurtTarget
(Entity p_21372_) protected void
dropCustomDeathLoot
(ServerLevel p_348683_, DamageSource p_21385_, boolean p_21387_) protected void
dropFromLootTable
(DamageSource p_21389_, boolean p_21390_) void
dropLeash
(boolean p_21456_, boolean p_21457_) void
dropPreservedEquipment
(Predicate<ItemStack> p_352191_) protected void
enchantSpawnedArmor
(ServerLevelAccessor p_348675_, RandomSource p_217052_, EquipmentSlot p_217054_, DifficultyInstance p_348681_) private void
enchantSpawnedEquipment
(ServerLevelAccessor p_348676_, EquipmentSlot p_345506_, RandomSource p_345779_, float p_345423_, DifficultyInstance p_348488_) protected void
enchantSpawnedWeapon
(ServerLevelAccessor p_348685_, RandomSource p_217049_, DifficultyInstance p_348671_) void
equip
(ResourceKey<LootTable> p_340912_, Map<EquipmentSlot, Float> p_340996_) void
equip
(EquipmentTable p_341198_) equipItemIfPossible
(ItemStack p_255842_) finalizeSpawn
(ServerLevelAccessor p_21434_, DifficultyInstance p_21435_, MobSpawnType p_21436_, SpawnGroupData p_21437_) Deprecated.Override-Only.protected SoundEvent
int
private double
getApproximateAttackDamageWithItem
(ItemStack p_330413_) protected AABB
protected int
protected ResourceKey
<LootTable> protected float
getEquipmentDropChance
(EquipmentSlot p_21520_) static Item
getEquipmentForSlot
(EquipmentSlot p_21413_, int p_21414_) int
getItemBySlot
(EquipmentSlot p_21467_) final ResourceKey
<LootTable> long
int
int
int
int
float
getPathfindingMalus
(PathType p_326934_) protected Vec3i
float
final MobSpawnType
Returns the type of spawn that created this mob, if applicable.protected final LivingEntity
void
handleEntityEvent
(byte p_21375_) private static boolean
hasAnyComponentExceptDamage
(ItemStack p_332136_) boolean
final InteractionResult
interact
(Player p_21420_, InteractionHand p_21421_) boolean
boolean
isBodyArmorItem
(ItemStack p_324454_) boolean
boolean
boolean
isMaxGroupSizeReached
(int p_21489_) boolean
isNoAi()
boolean
final boolean
This method exists so that spawns can be cancelled from theinvalid reference
FinalizeSpawnEvent
EntityJoinLevelEvent
.protected boolean
boolean
boolean
isWithinMeleeAttackRange
(LivingEntity p_217067_) boolean
boolean
isWithinRestriction
(BlockPos p_21445_) void
jumpInFluid
(FluidType type) Performs what to do when an entity attempts to go up or "jump" in a fluid.protected void
jumpInLiquid
(TagKey<Fluid> p_204045_) Deprecated.private void
jumpInLiquidInternal
(Runnable onSuper) void
void
protected InteractionResult
mobInteract
(Player p_21472_, InteractionHand p_21473_) protected void
onOffspringSpawnedFromEgg
(Player p_21422_, Mob p_21423_) void
void
protected void
pickUpItem
(ItemEntity p_21471_) void
protected void
protected void
playHurtSound
(DamageSource p_21493_) protected void
populateDefaultEquipmentEnchantments
(ServerLevelAccessor p_348529_, RandomSource p_217063_, DifficultyInstance p_217064_) protected void
populateDefaultEquipmentSlots
(RandomSource p_217055_, DifficultyInstance p_217056_) void
readAdditionalSaveData
(CompoundTag p_21450_) protected void
protected void
void
removeAllGoals
(Predicate<Goal> p_262667_) void
boolean
removeWhenFarAway
(double p_21542_) boolean
private void
void
restrictTo
(BlockPos p_21447_, int p_21448_) private float
rotlerp
(float p_21377_, float p_21378_, float p_21379_) protected void
protected final void
void
setAggressive
(boolean p_21562_) void
setBaby
(boolean p_21451_) void
setBodyArmorItem
(ItemStack p_323721_) void
setCanPickUpLoot
(boolean p_21554_) void
setDropChance
(EquipmentSlot p_21410_, float p_21411_) void
setGuaranteedDrop
(EquipmentSlot p_21509_) void
setItemSlot
(EquipmentSlot p_21416_, ItemStack p_21417_) protected void
setItemSlotAndDropWhenKilled
(EquipmentSlot p_21469_, ItemStack p_21470_) void
setLeashData
(Leashable.LeashData p_352221_) void
setLeftHanded
(boolean p_21560_) void
setNoAi
(boolean p_21558_) void
setPathfindingMalus
(PathType p_326826_, float p_21443_) void
final void
setSpawnCancelled
(boolean cancel) Marks this mob as being disallowed to spawn duringLevelWriter.addFreshEntity(Entity)
.void
setSpeed
(float p_21556_) void
setTarget
(LivingEntity p_21544_) void
setXxa
(float p_21571_) void
setYya
(float p_21568_) void
setZza
(float p_21565_) protected boolean
protected boolean
void
boolean
startRiding
(Entity p_21396_, boolean p_21397_) void
void
tick()
protected float
tickHeadTurn
(float p_21538_, float p_21539_) protected void
boolean
wantsToPickUp
(ItemStack p_21546_) Methods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, canUsePortal, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, die, doAutoAttackOnTouch, doesEmitEquipEvent, doHurtEquipment, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCombatTracker, getComfortableFallDistance, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDeathSound, getDefaultDimensions, getDefaultGravity, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getExperienceReward, getFallFlyingTicks, getFallSounds, getFluidFallingAdjustedMovement, getFlyingSpeed, getHealth, getHitbox, getHurtDir, getHurtSound, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getKnockback, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxAbsorption, getMaxHeadRotationRelativeToBody, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getProjectile, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSlotForHand, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getWeaponItem, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasInfiniteMaterials, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, igniteForTicks, increaseAirSupply, indicateDamage, internalSetAbsorptionAmount, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInvulnerableTo, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeBrain, makeSound, maxUpStep, onBelowWorld, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, onSyncedDataUpdated, playBlockFallSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, remove, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeEffectsCuredBy, removeFrost, resetForwardDirectionOfRelativePortalPosition, rideTick, sanitizeScale, sendEffectToPassengers, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRiderFaceForward, shouldShowName, skipDropExperience, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, tickRidden, travel, triggerItemUseEffects, triggerOnDeathMobEffects, tryAddFrost, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed, wouldNotSuffocateAtTargetPose
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyGravity, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canCollideWith, canControlVehicle, canRide, canSpawnSprintParticle, canSprint, canTrample, captureDrops, captureDrops, changeDimension, checkBelowWorld, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, push, reapplyPosition, refreshDimensions, registryAccess, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateInWaterStateAndDoWaterCurrentPushing, updateSwimming, waterSwimSound
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, removeData, serializeAttachments
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.minecraft.world.entity.EquipmentUser
equip, equip, equip, resolveSlot
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
Methods 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, shouldRiderSit
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, moveInFluid, self, sinkInFluid
Methods inherited from interface net.minecraft.world.entity.Leashable
canHaveALeashAttachedToIt, closeRangeLeashBehaviour, elasticRangeLeashBehaviour, getLeashHolder, handleLeashAtDistance, isLeashed, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashData
Methods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
DATA_MOB_FLAGS_ID
-
MOB_FLAG_NO_AI
private static final int MOB_FLAG_NO_AI- See Also:
-
MOB_FLAG_LEFTHANDED
private static final int MOB_FLAG_LEFTHANDED- See Also:
-
MOB_FLAG_AGGRESSIVE
private static final int MOB_FLAG_AGGRESSIVE- See Also:
-
PICKUP_REACH
protected static final int PICKUP_REACH- See Also:
-
ITEM_PICKUP_REACH
-
MAX_WEARING_ARMOR_CHANCE
public static final float MAX_WEARING_ARMOR_CHANCE- See Also:
-
MAX_PICKUP_LOOT_CHANCE
public static final float MAX_PICKUP_LOOT_CHANCE- See Also:
-
MAX_ENCHANTED_ARMOR_CHANCE
public static final float MAX_ENCHANTED_ARMOR_CHANCE- See Also:
-
MAX_ENCHANTED_WEAPON_CHANCE
public static final float MAX_ENCHANTED_WEAPON_CHANCE- See Also:
-
DEFAULT_EQUIPMENT_DROP_CHANCE
public static final float DEFAULT_EQUIPMENT_DROP_CHANCE- See Also:
-
PRESERVE_ITEM_DROP_CHANCE_THRESHOLD
public static final float PRESERVE_ITEM_DROP_CHANCE_THRESHOLD- See Also:
-
PRESERVE_ITEM_DROP_CHANCE
public static final int PRESERVE_ITEM_DROP_CHANCE- See Also:
-
UPDATE_GOAL_SELECTOR_EVERY_N_TICKS
public static final int UPDATE_GOAL_SELECTOR_EVERY_N_TICKS- See Also:
-
DEFAULT_ATTACK_REACH
private static final double DEFAULT_ATTACK_REACH -
RANDOM_SPAWN_BONUS_ID
-
ambientSoundTime
public int ambientSoundTime -
xpReward
protected int xpReward -
lookControl
-
moveControl
-
jumpControl
-
bodyRotationControl
-
goalSelector
-
targetSelector
-
target
-
sensing
-
handItems
-
handDropChances
protected final float[] handDropChances -
armorItems
-
armorDropChances
protected final float[] armorDropChances -
bodyArmorItem
-
bodyArmorDropChance
protected float bodyArmorDropChance -
canPickUpLoot
private boolean canPickUpLoot -
persistenceRequired
private boolean persistenceRequired -
pathfindingMalus
-
lootTable
-
lootTableSeed
private long lootTableSeed -
leashData
-
restrictCenter
-
restrictRadius
private float restrictRadius -
spawnType
-
spawnCancelled
private boolean spawnCancelled
-
-
Constructor Details
-
Mob
-
-
Method Details
-
registerGoals
protected void registerGoals() -
createMobAttributes
-
shouldPassengersInheritMalus
protected boolean shouldPassengersInheritMalus() -
getPathfindingMalus
-
setPathfindingMalus
-
onPathfindingStart
public void onPathfindingStart() -
onPathfindingDone
public void onPathfindingDone() -
createBodyControl
-
getLookControl
-
getMoveControl
-
getJumpControl
-
getControllingPassenger
- Overrides:
getControllingPassenger
in classEntity
-
getSensing
-
getTarget
-
getTargetFromBrain
-
setTarget
-
canAttackType
- Overrides:
canAttackType
in classLivingEntity
-
canFireProjectileWeapon
-
ate
public void ate() -
defineSynchedData
- Overrides:
defineSynchedData
in classLivingEntity
-
getAmbientSoundInterval
public int getAmbientSoundInterval() -
playAmbientSound
public void playAmbientSound() -
baseTick
public void baseTick()- Overrides:
baseTick
in classLivingEntity
-
playHurtSound
- Overrides:
playHurtSound
in classLivingEntity
-
resetAmbientSoundTime
private void resetAmbientSoundTime() -
getBaseExperienceReward
protected int getBaseExperienceReward()- Overrides:
getBaseExperienceReward
in classLivingEntity
-
spawnAnim
public void spawnAnim() -
handleEntityEvent
public void handleEntityEvent(byte p_21375_) - Overrides:
handleEntityEvent
in classLivingEntity
-
tick
public void tick()- Overrides:
tick
in classLivingEntity
-
updateControlFlags
protected void updateControlFlags() -
tickHeadTurn
protected float tickHeadTurn(float p_21538_, float p_21539_) - Overrides:
tickHeadTurn
in classLivingEntity
-
getAmbientSound
-
addAdditionalSaveData
- Overrides:
addAdditionalSaveData
in classLivingEntity
-
readAdditionalSaveData
- Overrides:
readAdditionalSaveData
in classLivingEntity
-
dropFromLootTable
- Overrides:
dropFromLootTable
in classLivingEntity
-
getLootTable
- Overrides:
getLootTable
in classLivingEntity
-
getDefaultLootTable
-
getLootTableSeed
public long getLootTableSeed()- Overrides:
getLootTableSeed
in classLivingEntity
-
setZza
public void setZza(float p_21565_) -
setYya
public void setYya(float p_21568_) -
setXxa
public void setXxa(float p_21571_) -
setSpeed
public void setSpeed(float p_21556_) - Overrides:
setSpeed
in classLivingEntity
-
stopInPlace
public void stopInPlace() -
aiStep
public void aiStep()- Overrides:
aiStep
in classLivingEntity
-
getPickupReach
-
pickUpItem
-
equipItemIfPossible
-
setItemSlotAndDropWhenKilled
-
setGuaranteedDrop
-
canReplaceCurrentItem
-
getApproximateAttackDamageWithItem
-
canReplaceEqualItem
-
hasAnyComponentExceptDamage
-
canHoldItem
-
wantsToPickUp
-
removeWhenFarAway
public boolean removeWhenFarAway(double p_21542_) -
requiresCustomPersistence
public boolean requiresCustomPersistence() -
shouldDespawnInPeaceful
protected boolean shouldDespawnInPeaceful() -
checkDespawn
public void checkDespawn()- Overrides:
checkDespawn
in classEntity
-
serverAiStep
protected final void serverAiStep()- Overrides:
serverAiStep
in classLivingEntity
-
sendDebugPackets
protected void sendDebugPackets() -
customServerAiStep
protected void customServerAiStep() -
getMaxHeadXRot
public int getMaxHeadXRot() -
getMaxHeadYRot
public int getMaxHeadYRot() -
clampHeadRotationToBody
protected void clampHeadRotationToBody() -
getHeadRotSpeed
public int getHeadRotSpeed() -
lookAt
-
rotlerp
private float rotlerp(float p_21377_, float p_21378_, float p_21379_) -
checkMobSpawnRules
public static boolean checkMobSpawnRules(EntityType<? extends Mob> p_217058_, LevelAccessor p_217059_, MobSpawnType p_217060_, BlockPos p_217061_, RandomSource p_217062_) -
checkSpawnRules
-
checkSpawnObstruction
-
getMaxSpawnClusterSize
public int getMaxSpawnClusterSize() -
isMaxGroupSizeReached
public boolean isMaxGroupSizeReached(int p_21489_) -
getMaxFallDistance
public int getMaxFallDistance()- Overrides:
getMaxFallDistance
in classLivingEntity
-
getHandSlots
- Overrides:
getHandSlots
in classLivingEntity
-
getArmorSlots
- Specified by:
getArmorSlots
in classLivingEntity
-
getBodyArmorItem
-
canUseSlot
- Overrides:
canUseSlot
in classLivingEntity
-
isWearingBodyArmor
public boolean isWearingBodyArmor() -
isBodyArmorItem
-
setBodyArmorItem
-
getArmorAndBodyArmorSlots
- Overrides:
getArmorAndBodyArmorSlots
in classLivingEntity
-
getItemBySlot
- Specified by:
getItemBySlot
in interfaceEquipmentUser
- Specified by:
getItemBySlot
in classLivingEntity
-
setItemSlot
- Specified by:
setItemSlot
in interfaceEquipmentUser
- Specified by:
setItemSlot
in classLivingEntity
-
dropCustomDeathLoot
- Overrides:
dropCustomDeathLoot
in classLivingEntity
-
getEquipmentDropChance
-
dropPreservedEquipment
public void dropPreservedEquipment() -
dropPreservedEquipment
-
createEquipmentParams
-
equip
-
equip
-
populateDefaultEquipmentSlots
-
getEquipmentForSlot
-
populateDefaultEquipmentEnchantments
protected void populateDefaultEquipmentEnchantments(ServerLevelAccessor p_348529_, RandomSource p_217063_, DifficultyInstance p_217064_) -
enchantSpawnedWeapon
protected void enchantSpawnedWeapon(ServerLevelAccessor p_348685_, RandomSource p_217049_, DifficultyInstance p_348671_) -
enchantSpawnedArmor
protected void enchantSpawnedArmor(ServerLevelAccessor p_348675_, RandomSource p_217052_, EquipmentSlot p_217054_, DifficultyInstance p_348681_) -
enchantSpawnedEquipment
private void enchantSpawnedEquipment(ServerLevelAccessor p_348676_, EquipmentSlot p_345506_, RandomSource p_345779_, float p_345423_, DifficultyInstance p_348488_) -
finalizeSpawn
@Deprecated @OverrideOnly @Nullable public SpawnGroupData finalizeSpawn(ServerLevelAccessor p_21434_, DifficultyInstance p_21435_, MobSpawnType p_21436_, @Nullable SpawnGroupData p_21437_) Deprecated. -
setPersistenceRequired
public void setPersistenceRequired() -
setDropChance
- Specified by:
setDropChance
in interfaceEquipmentUser
-
canPickUpLoot
public boolean canPickUpLoot() -
setCanPickUpLoot
public void setCanPickUpLoot(boolean p_21554_) -
canTakeItem
- Overrides:
canTakeItem
in classLivingEntity
-
isPersistenceRequired
public boolean isPersistenceRequired() -
interact
-
checkAndHandleImportantInteractions
private InteractionResult checkAndHandleImportantInteractions(Player p_21500_, InteractionHand p_21501_) -
onOffspringSpawnedFromEgg
-
mobInteract
-
isWithinRestriction
public boolean isWithinRestriction() -
isWithinRestriction
-
restrictTo
-
getRestrictCenter
-
getRestrictRadius
public float getRestrictRadius() -
clearRestriction
public void clearRestriction() -
hasRestriction
public boolean hasRestriction() -
convertTo
-
getLeashData
- Specified by:
getLeashData
in interfaceLeashable
-
setLeashData
- Specified by:
setLeashData
in interfaceLeashable
-
dropLeash
public void dropLeash(boolean p_21456_, boolean p_21457_) -
leashTooFarBehaviour
public void leashTooFarBehaviour()- Specified by:
leashTooFarBehaviour
in interfaceLeashable
-
canBeLeashed
public boolean canBeLeashed()- Specified by:
canBeLeashed
in interfaceLeashable
-
startRiding
- Overrides:
startRiding
in classEntity
-
isEffectiveAi
public boolean isEffectiveAi()- Overrides:
isEffectiveAi
in classEntity
-
setNoAi
public void setNoAi(boolean p_21558_) -
setLeftHanded
public void setLeftHanded(boolean p_21560_) -
setAggressive
public void setAggressive(boolean p_21562_) -
isNoAi
public boolean isNoAi() -
isLeftHanded
public boolean isLeftHanded() -
isAggressive
public boolean isAggressive() -
setBaby
public void setBaby(boolean p_21451_) -
getMainArm
- Specified by:
getMainArm
in classLivingEntity
-
isWithinMeleeAttackRange
-
getAttackBoundingBox
-
doHurtTarget
- Overrides:
doHurtTarget
in classLivingEntity
-
playAttackSound
protected void playAttackSound() -
isSunBurnTick
protected boolean isSunBurnTick() -
jumpInLiquid
Deprecated.- Overrides:
jumpInLiquid
in classLivingEntity
-
jumpInLiquidInternal
-
jumpInFluid
Description copied from interface:ILivingEntityExtension
Performs what to do when an entity attempts to go up or "jump" in a fluid.- Specified by:
jumpInFluid
in interfaceILivingEntityExtension
- Parameters:
type
- the type of the fluid
-
removeFreeWill
public void removeFreeWill() -
removeAllGoals
-
removeAfterChangingDimensions
protected void removeAfterChangingDimensions()- Overrides:
removeAfterChangingDimensions
in classEntity
-
getPickResult
- Overrides:
getPickResult
in classEntity
-
getSpawnType
Returns the type of spawn that created this mob, if applicable. If it could not be determined, this will return null.This is set via
finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.DifficultyInstance, net.minecraft.world.entity.MobSpawnType, net.minecraft.world.entity.SpawnGroupData)
, so you should not call this from within that method, instead using the parameter. -
isSpawnCancelled
@Internal public final boolean isSpawnCancelled()This method exists so that spawns can be cancelled from theinvalid reference
FinalizeSpawnEvent
EntityJoinLevelEvent
.- Returns:
- if this mob will be blocked from spawning during
LevelWriter.addFreshEntity(Entity)
-
setSpawnCancelled
@Internal public final void setSpawnCancelled(boolean cancel) Marks this mob as being disallowed to spawn duringLevelWriter.addFreshEntity(Entity)
.- Throws:
UnsupportedOperationException
- if this entity has already beenadded to the world
.
-