Class AbstractHorse
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.Mob
net.minecraft.world.entity.PathfinderMob
net.minecraft.world.entity.AgeableMob
net.minecraft.world.entity.animal.Animal
net.minecraft.world.entity.animal.horse.AbstractHorse
- All Implemented Interfaces:
CommandSource
,SyncedDataHolder
,ContainerListener
,Attackable
,EquipmentUser
,HasCustomInventoryScreen
,Leashable
,OwnableEntity
,PlayerRideable
,PlayerRideableJumping
,Saddleable
,Targeting
,EntityAccess
,Nameable
,ScoreHolder
,IAttachmentHolder
,IEntityExtension
,ILivingEntityExtension
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
AbstractChestedHorse
,Camel
,Horse
,SkeletonHorse
,ZombieHorse
public abstract class AbstractHorse
extends Animal
implements ContainerListener, HasCustomInventoryScreen, OwnableEntity, PlayerRideableJumping, Saddleable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.AgeableMob
AgeableMob.AgeableMobGroupData
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
FieldsModifier and TypeFieldDescriptionprotected boolean
private static final float
private final Container
static final double
protected boolean
static final int
private static final EntityDataAccessor
<Byte> private float
private float
private int
static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
protected int
Used to determine the sound that the horse should make when it stepsstatic final int
static final int
protected SimpleContainer
static final int
protected boolean
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final TargetingConditions
private float
private float
private int
private UUID
private static final Predicate
<LivingEntity> protected float
private static final float
int
private float
private float
private int
int
protected int
The higher this value, the more likely the horse is to be tamed next time a player rides it.Fields inherited from class net.minecraft.world.entity.animal.Animal
PARENT_AGE_AFTER_BREEDING
Fields inherited from class net.minecraft.world.entity.AgeableMob
age, BABY_START_AGE, forcedAge, forcedAgeTimer
Fields inherited from class net.minecraft.world.entity.PathfinderMob
DEFAULT_WALK_TARGET_VALUE
Fields inherited from class net.minecraft.world.entity.Mob
ambientSoundTime, armorDropChances, bodyArmorDropChance, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, lookControl, MAX_ENCHANTED_ARMOR_CHANCE, MAX_ENCHANTED_WEAPON_CHANCE, MAX_PICKUP_LOOT_CHANCE, MAX_WEARING_ARMOR_CHANCE, moveControl, navigation, PICKUP_REACH, PRESERVE_ITEM_DROP_CHANCE, PRESERVE_ITEM_DROP_CHANCE_THRESHOLD, RANDOM_SPAWN_BONUS_ID, targetSelector, UPDATE_GOAL_SELECTOR_EVERY_N_TICKS, xpReward
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, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, 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
ConstructorsModifierConstructorDescriptionprotected
AbstractHorse
(EntityType<? extends AbstractHorse> pEntityType, Level pLevel) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalSaveData
(CompoundTag pCompound) protected void
void
aiStep()
boolean
boolean
canJump()
boolean
Returnstrue
if the mob is currently able to mate with the specified mob.protected boolean
protected boolean
boolean
causeFallDamage
(float pFallDistance, float pMultiplier, DamageSource pSource) void
containerChanged
(Container pInvBasic) Called byInventoryBasic.onInventoryChanged()
on an array that is never filled.static AttributeSupplier.Builder
protected void
(package private) static double
createOffspringAttribute
(double pValue1, double pValue2, double pMin, double pMax, RandomSource pRandom) protected void
defineSynchedData
(SynchedEntityData.Builder pBuilder) protected void
doPlayerRide
(Player pPlayer) protected void
private void
eating()
void
equipBodyArmor
(Player pPlayer, ItemStack pStack) void
equipSaddle
(ItemStack pStack, SoundSource pSoundSource) protected void
executeRidersJump
(float pPlayerJumpPendingScale, Vec3 pTravelVector) finalizeSpawn
(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pSpawnType, SpawnGroupData pSpawnGroupData) protected void
protected static double
generateJumpStrength
(DoubleSupplier pSupplier) protected static float
generateMaxHealth
(IntUnaryOperator pOperator) protected static double
generateSpeed
(DoubleSupplier pSupplier) int
int
protected SoundEvent
final Container
getBreedOffspring
(ServerLevel pLevel, AgeableMob pOtherParent) getDismountLocationForPassenger
(LivingEntity pLivingEntity) private Vec3
getDismountLocationInDirection
(Vec3 pDirection, LivingEntity pPassenger) float
getEatAnim
(float pPartialTick) protected SoundEvent
protected boolean
getFlag
(int pFlagId) int
final int
static int
getInventorySize
(int pColumns) int
int
float
getMouthAnim
(float pPartialTick) protected Vec3
getPassengerAttachmentPoint
(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) protected Vec3
getRiddenInput
(Player pPlayer, Vec3 pTravelVector) protected Vec2
getRiddenRotation
(LivingEntity pEntity) protected float
getRiddenSpeed
(Player pPlayer) getSlot
(int pSlot) protected float
float
getStandAnim
(float pPartialTick) int
protected boolean
handleEating
(Player pPlayer, ItemStack pStack) void
handleEntityEvent
(byte pId) Handler forinvalid reference
World#setEntityState
boolean
handleLeashAtDistance
(Entity pLeashHolder, float pDistance) void
handleStartJump
(int pJumpPower) void
boolean
hasInventoryChanged
(Container pInventory) boolean
hurt
(DamageSource pSource, float pAmount) Called when the entity is attacked.boolean
isBred()
boolean
isEating()
boolean
Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type)boolean
boolean
boolean
boolean
boolean
boolean
boolean
isTamed()
private boolean
isWoodSoundType
(SoundType pSoundType) void
makeMad()
mobInteract
(Player pPlayer, InteractionHand pHand) int
modifyTemper
(int pAddedTemper) private void
moveTail()
boolean
void
onPlayerJump
(int pJumpPower) void
openCustomInventoryScreen
(Player pPlayer) private void
protected void
playGallopSound
(SoundType pSoundType) protected void
protected void
playStepSound
(BlockPos pPos, BlockState pBlock) protected void
positionRider
(Entity pPassenger, Entity.MoveFunction pCallback) protected void
randomizeAttributes
(RandomSource pRandom) void
readAdditionalSaveData
(CompoundTag pCompound) (abstract) Protected helper method to read subclass entity data from NBT.protected void
void
setBred
(boolean pBreeding) void
setEating
(boolean pEating) protected void
setFlag
(int pFlagId, boolean pValue) void
setIsJumping
(boolean pJumping) private void
setOffspringAttribute
(AgeableMob pParent, AbstractHorse pChild, Holder<Attribute> pAttribute, double pMin, double pMax) protected void
setOffspringAttributes
(AgeableMob pParent, AbstractHorse pChild) void
setOwnerUUID
(UUID pUuid) void
setStanding
(boolean pStanding) void
setTamed
(boolean pTamed) void
setTemper
(int pTemper) protected void
spawnTamingParticles
(boolean pTamed) Spawns particles for the horse entity.void
protected void
boolean
tameWithName
(Player pPlayer) void
tick()
protected void
tickRidden
(Player pPlayer, Vec3 pTravelVector) Methods inherited from class net.minecraft.world.entity.animal.Animal
actuallyHurt, canFallInLove, checkAnimalSpawnRules, customServerAiStep, finalizeSpawnChildFromBreeding, getBaseExperienceReward, getInLoveTime, getLoveCause, getWalkTargetValue, isBrightEnoughToSpawn, isInLove, removeWhenFarAway, resetLove, setInLove, setInLoveTime, spawnChildFromBreeding, usePlayerItem
Methods inherited from class net.minecraft.world.entity.AgeableMob
ageBoundaryReached, ageUp, ageUp, canBreed, getAge, getSpeedUpSecondsWhenFeeding, isBaby, onSyncedDataUpdated, setAge, setBaby
Methods inherited from class net.minecraft.world.entity.PathfinderMob
checkSpawnRules, closeRangeLeashBehaviour, followLeashSpeed, getWalkTargetValue, isPanicking, isPathFinding, shouldStayCloseToLeashHolder
Methods inherited from class net.minecraft.world.entity.Mob
ate, baseTick, canAttackType, canBeLeashed, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, canUseSlot, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clampHeadRotationToBody, clearRestriction, convertTo, createBodyControl, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, dropPreservedEquipment, dropPreservedEquipment, enchantSpawnedArmor, enchantSpawnedWeapon, equip, equip, equipItemIfPossible, getAmbientSound, getArmorAndBodyArmorSlots, getArmorSlots, getAttackBoundingBox, getBodyArmorItem, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashData, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMoveControl, getNavigation, getPathfindingMalus, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, getTargetFromBrain, hasRestriction, interact, isAggressive, isBodyArmorItem, isEffectiveAi, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSpawnCancelled, isSunBurnTick, isWearingBodyArmor, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, leashTooFarBehaviour, lookAt, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playAttackSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBodyArmorItem, setCanPickUpLoot, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashData, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, stopInPlace, tickHeadTurn, updateControlFlags, wantsToPickUp
Methods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, canUsePortal, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, die, doAutoAttackOnTouch, doesEmitEquipEvent, doHurtEquipment, doPush, dropAllDeathLoot, dropExperience, eat, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, 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, getScale, getSleepingPos, getSlotForHand, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getWeaponItem, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasInfiniteMaterials, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, heal, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, igniteForTicks, increaseAirSupply, indicateDamage, internalSetAbsorptionAmount, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInvulnerableTo, isInWall, isPickable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeBrain, makeSound, maxUpStep, onBelowWorld, onChangedBlock, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, 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, 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, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, 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, 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, isAddedToLevel, 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, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playSwimSound, position, 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, updateSwimming, waterSwimSound
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, 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, getExistingData, getExistingDataOrNull, 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, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, serializeNBT, shouldRiderSit
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, moveInFluid, onDamageTaken, self, sinkInFluid
Methods inherited from interface net.minecraft.world.entity.Leashable
canHaveALeashAttachedToIt, elasticRangeLeashBehaviour, getLeashHolder, isLeashed, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashData
Methods inherited from interface net.minecraft.world.entity.OwnableEntity
getOwner, level
Methods inherited from interface net.minecraft.world.entity.PlayerRideableJumping
getJumpCooldown
Methods inherited from interface net.minecraft.world.entity.Saddleable
getSaddleSoundEvent
Methods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
EQUIPMENT_SLOT_OFFSET
public static final int EQUIPMENT_SLOT_OFFSET- See Also:
-
CHEST_SLOT_OFFSET
public static final int CHEST_SLOT_OFFSET- See Also:
-
INVENTORY_SLOT_OFFSET
public static final int INVENTORY_SLOT_OFFSET- See Also:
-
BREEDING_CROSS_FACTOR
public static final double BREEDING_CROSS_FACTOR- See Also:
-
MIN_MOVEMENT_SPEED
private static final float MIN_MOVEMENT_SPEED -
MAX_MOVEMENT_SPEED
private static final float MAX_MOVEMENT_SPEED -
MIN_JUMP_STRENGTH
private static final float MIN_JUMP_STRENGTH -
MAX_JUMP_STRENGTH
private static final float MAX_JUMP_STRENGTH -
MIN_HEALTH
private static final float MIN_HEALTH -
MAX_HEALTH
private static final float MAX_HEALTH -
BACKWARDS_MOVE_SPEED_FACTOR
private static final float BACKWARDS_MOVE_SPEED_FACTOR- See Also:
-
SIDEWAYS_MOVE_SPEED_FACTOR
private static final float SIDEWAYS_MOVE_SPEED_FACTOR- See Also:
-
PARENT_HORSE_SELECTOR
-
MOMMY_TARGETING
-
DATA_ID_FLAGS
-
FLAG_TAME
private static final int FLAG_TAME- See Also:
-
FLAG_SADDLE
private static final int FLAG_SADDLE- See Also:
-
FLAG_BRED
private static final int FLAG_BRED- See Also:
-
FLAG_EATING
private static final int FLAG_EATING- See Also:
-
FLAG_STANDING
private static final int FLAG_STANDING- See Also:
-
FLAG_OPEN_MOUTH
private static final int FLAG_OPEN_MOUTH- See Also:
-
INV_SLOT_SADDLE
public static final int INV_SLOT_SADDLE- See Also:
-
INV_BASE_COUNT
public static final int INV_BASE_COUNT- See Also:
-
eatingCounter
private int eatingCounter -
mouthCounter
private int mouthCounter -
standCounter
private int standCounter -
tailCounter
public int tailCounter -
sprintCounter
public int sprintCounter -
isJumping
protected boolean isJumping -
inventory
-
temper
protected int temperThe higher this value, the more likely the horse is to be tamed next time a player rides it. -
playerJumpPendingScale
protected float playerJumpPendingScale -
allowStandSliding
protected boolean allowStandSliding -
eatAnim
private float eatAnim -
eatAnimO
private float eatAnimO -
standAnim
private float standAnim -
standAnimO
private float standAnimO -
mouthAnim
private float mouthAnim -
mouthAnimO
private float mouthAnimO -
canGallop
protected boolean canGallop -
gallopSoundCounter
protected int gallopSoundCounterUsed to determine the sound that the horse should make when it steps -
owner
-
bodyArmorAccess
-
-
Constructor Details
-
AbstractHorse
-
-
Method Details
-
registerGoals
protected void registerGoals()- Overrides:
registerGoals
in classMob
-
addBehaviourGoals
protected void addBehaviourGoals() -
defineSynchedData
- Overrides:
defineSynchedData
in classAgeableMob
-
getFlag
protected boolean getFlag(int pFlagId) -
setFlag
protected void setFlag(int pFlagId, boolean pValue) -
isTamed
public boolean isTamed() -
getOwnerUUID
- Specified by:
getOwnerUUID
in interfaceOwnableEntity
-
setOwnerUUID
-
isJumping
public boolean isJumping() -
setTamed
public void setTamed(boolean pTamed) -
setIsJumping
public void setIsJumping(boolean pJumping) -
handleLeashAtDistance
- Specified by:
handleLeashAtDistance
in interfaceLeashable
- Overrides:
handleLeashAtDistance
in classPathfinderMob
-
isEating
public boolean isEating() -
isStanding
public boolean isStanding() -
isBred
public boolean isBred() -
setBred
public void setBred(boolean pBreeding) -
isSaddleable
public boolean isSaddleable()- Specified by:
isSaddleable
in interfaceSaddleable
-
equipSaddle
- Specified by:
equipSaddle
in interfaceSaddleable
-
equipBodyArmor
-
isSaddled
public boolean isSaddled()- Specified by:
isSaddled
in interfaceSaddleable
-
getTemper
public int getTemper() -
setTemper
public void setTemper(int pTemper) -
modifyTemper
public int modifyTemper(int pAddedTemper) -
isPushable
public boolean isPushable()- Overrides:
isPushable
in classLivingEntity
-
eating
private void eating() -
causeFallDamage
- Overrides:
causeFallDamage
in classLivingEntity
-
getInventorySize
public final int getInventorySize() -
getInventorySize
public static int getInventorySize(int pColumns) -
createInventory
protected void createInventory() -
syncSaddleToClients
protected void syncSaddleToClients() -
containerChanged
Called byInventoryBasic.onInventoryChanged()
on an array that is never filled.- Specified by:
containerChanged
in interfaceContainerListener
-
hurt
Called when the entity is attacked.- Overrides:
hurt
in classLivingEntity
-
canPerformRearing
protected boolean canPerformRearing() -
getEatingSound
-
getAngrySound
-
playStepSound
- Overrides:
playStepSound
in classEntity
-
isWoodSoundType
-
playGallopSound
-
createBaseHorseAttributes
-
getMaxSpawnClusterSize
public int getMaxSpawnClusterSize()- Overrides:
getMaxSpawnClusterSize
in classMob
-
getMaxTemper
public int getMaxTemper() -
getSoundVolume
protected float getSoundVolume()- Overrides:
getSoundVolume
in classLivingEntity
-
getAmbientSoundInterval
public int getAmbientSoundInterval()- Overrides:
getAmbientSoundInterval
in classAnimal
-
openCustomInventoryScreen
- Specified by:
openCustomInventoryScreen
in interfaceHasCustomInventoryScreen
-
fedFood
-
handleEating
-
doPlayerRide
-
isImmobile
public boolean isImmobile()- Overrides:
isImmobile
in classLivingEntity
-
isFood
Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type) -
moveTail
private void moveTail() -
dropEquipment
protected void dropEquipment()- Overrides:
dropEquipment
in classLivingEntity
-
aiStep
public void aiStep() -
followMommy
protected void followMommy() -
canEatGrass
public boolean canEatGrass() -
tick
public void tick() -
mobInteract
- Overrides:
mobInteract
in classAnimal
-
openMouth
private void openMouth() -
setEating
public void setEating(boolean pEating) -
setStanding
public void setStanding(boolean pStanding) -
getAmbientStandSound
-
standIfPossible
public void standIfPossible() -
makeMad
public void makeMad() -
tameWithName
-
tickRidden
- Overrides:
tickRidden
in classLivingEntity
-
getRiddenRotation
-
getRiddenInput
- Overrides:
getRiddenInput
in classLivingEntity
-
getRiddenSpeed
- Overrides:
getRiddenSpeed
in classLivingEntity
-
executeRidersJump
-
playJumpSound
protected void playJumpSound() -
addAdditionalSaveData
- Overrides:
addAdditionalSaveData
in classAnimal
-
readAdditionalSaveData
(abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readAdditionalSaveData
in classAnimal
-
canMate
Returnstrue
if the mob is currently able to mate with the specified mob. -
canParent
protected boolean canParent() -
getBreedOffspring
- Specified by:
getBreedOffspring
in classAgeableMob
-
setOffspringAttributes
-
setOffspringAttribute
private void setOffspringAttribute(AgeableMob pParent, AbstractHorse pChild, Holder<Attribute> pAttribute, double pMin, double pMax) -
createOffspringAttribute
static double createOffspringAttribute(double pValue1, double pValue2, double pMin, double pMax, RandomSource pRandom) -
getEatAnim
public float getEatAnim(float pPartialTick) -
getStandAnim
public float getStandAnim(float pPartialTick) -
getMouthAnim
public float getMouthAnim(float pPartialTick) -
onPlayerJump
public void onPlayerJump(int pJumpPower) - Specified by:
onPlayerJump
in interfacePlayerRideableJumping
-
canJump
public boolean canJump()- Specified by:
canJump
in interfacePlayerRideableJumping
-
handleStartJump
public void handleStartJump(int pJumpPower) - Specified by:
handleStartJump
in interfacePlayerRideableJumping
-
handleStopJump
public void handleStopJump()- Specified by:
handleStopJump
in interfacePlayerRideableJumping
-
spawnTamingParticles
protected void spawnTamingParticles(boolean pTamed) Spawns particles for the horse entity.- Parameters:
pTamed
- whether to spawn hearts or smoke.
-
handleEntityEvent
public void handleEntityEvent(byte pId) Handler forinvalid reference
World#setEntityState
- Overrides:
handleEntityEvent
in classAnimal
-
positionRider
- Overrides:
positionRider
in classEntity
-
generateMaxHealth
-
generateJumpStrength
-
generateSpeed
-
onClimbable
public boolean onClimbable()- Overrides:
onClimbable
in classLivingEntity
-
getSlot
- Overrides:
getSlot
in classLivingEntity
-
getControllingPassenger
- Overrides:
getControllingPassenger
in classMob
-
getDismountLocationInDirection
-
getDismountLocationForPassenger
- Overrides:
getDismountLocationForPassenger
in classEntity
-
randomizeAttributes
-
finalizeSpawn
@Nullable public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pSpawnType, @Nullable SpawnGroupData pSpawnGroupData) - Overrides:
finalizeSpawn
in classAgeableMob
-
getInventory
-
hasInventoryChanged
-
getAmbientStandInterval
public int getAmbientStandInterval() -
getPassengerAttachmentPoint
protected Vec3 getPassengerAttachmentPoint(Entity pEntity, EntityDimensions pDimensions, float pPartialTick) - Overrides:
getPassengerAttachmentPoint
in classEntity
-
getBodyArmorAccess
-
getInventoryColumns
public int getInventoryColumns()
-