public abstract class AbstractHorse extends EntityAnimal implements IInventoryChangedListener, IJumpingMount
EntityLiving.SpawnPlacementType
Modifier and Type | Field and Description |
---|---|
protected boolean |
canGallop |
protected int |
gallopTime
Used to determine the sound that the horse should make when it steps
|
protected ContainerHorseChest |
horseChest |
protected boolean |
horseJumping |
protected static IAttribute |
JUMP_STRENGTH |
protected float |
jumpPower |
int |
sprintCounter |
int |
tailCounter |
protected int |
temper
"The higher this value, the more likely the horse is to be tamed next time a player rides it."
|
spawnableBlock
forcedAge, forcedAgeTimer, growingAge
FLEEING_SPEED_MODIFIER, FLEEING_SPEED_MODIFIER_UUID
experienceValue, inventoryArmorDropChances, inventoryHandsDropChances, jumpHelper, livingSoundTime, moveHelper, navigator, targetTasks, tasks
activeItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, HAND_STATES, hurtTime, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180
addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world
Constructor and Description |
---|
AbstractHorse(World worldIn) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyEntityAttributes() |
boolean |
attackEntityFrom(DamageSource source,
float amount)
Called when the entity is attacked.
|
boolean |
canBeLeashedTo(EntityPlayer player) |
boolean |
canBePushed()
Returns true if this entity should push and be pushed by other entities when colliding.
|
boolean |
canBeSaddled() |
boolean |
canBeSteered()
returns true if all the conditions for steering the entity are met.
|
boolean |
canEatGrass() |
boolean |
canJump() |
protected boolean |
canMate()
Return true if the horse entity ready to mate.
|
boolean |
canMateWith(EntityAnimal otherAnimal)
Returns true if the mob is currently able to mate with the specified mob.
|
EntityAgeable |
createChild(EntityAgeable ageable) |
protected void |
entityInit() |
void |
fall(float distance,
float damageMultiplier) |
protected void |
followMother() |
protected SoundEvent |
getAmbientSound() |
protected SoundEvent |
getAngrySound() |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
protected AbstractHorse |
getClosestHorse(Entity entityIn,
double distance) |
Entity |
getControllingPassenger()
For vehicles, the first passenger is generally considered the controller and "drives" the vehicle.
|
protected SoundEvent |
getDeathSound() |
float |
getEyeHeight() |
float |
getGrassEatingAmount(float p_110258_1_) |
double |
getHorseJumpStrength() |
float |
getHorseSize() |
protected boolean |
getHorseWatchableBoolean(int p_110233_1_) |
protected SoundEvent |
getHurtSound() |
protected int |
getInventorySize() |
int |
getMaxSpawnedInChunk()
Will return how many at most can spawn in a chunk at once.
|
int |
getMaxTemper() |
protected double |
getModifiedJumpStrength()
Returns randomized jump strength
|
protected float |
getModifiedMaxHealth()
Returns randomized max health
|
protected double |
getModifiedMovementSpeed()
Returns randomized movement speed
|
float |
getMouthOpennessAngle(float p_110201_1_) |
java.util.UUID |
getOwnerUniqueId() |
float |
getRearingAmount(float p_110223_1_) |
protected float |
getSoundVolume()
Returns the volume for the sounds this mob makes.
|
int |
getTalkInterval()
Get number of ticks, at least during which the living entity will be silent.
|
int |
getTemper() |
protected boolean |
handleEating(EntityPlayer player,
ItemStack stack) |
void |
handleStartJump(int p_184775_1_) |
void |
handleStatusUpdate(byte id) |
void |
handleStopJump() |
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
int |
increaseTemper(int p_110198_1_) |
protected void |
initEntityAI() |
protected void |
initHorseChest() |
boolean |
isArmor(ItemStack stack) |
boolean |
isBreeding() |
boolean |
isBreedingItem(ItemStack stack)
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 |
isEatingHaystack() |
boolean |
isHorseJumping() |
boolean |
isHorseSaddled() |
protected boolean |
isMovementBlocked()
Dead and sleeping entities cannot move
|
boolean |
isOnLadder()
returns true if this entity is by a ladder, false otherwise
|
boolean |
isRearing() |
boolean |
isTame() |
void |
makeMad() |
protected void |
mountTo(EntityPlayer player) |
void |
moveEntityWithHeading(float strafe,
float forward)
Moves the entity based on the specified heading.
|
void |
onDeath(DamageSource cause)
Called when the mob's health reaches 0.
|
IEntityLivingData |
onInitialSpawn(DifficultyInstance difficulty,
IEntityLivingData livingdata)
Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called
when entity is reloaded from nbt.
|
void |
onInventoryChanged(IInventory invBasic)
Called by InventoryBasic.onInventoryChanged() on a array that is never filled.
|
protected void |
onLeashDistance(float p_142017_1_) |
void |
onLivingUpdate()
Called frequently so the entity can update its state every tick as required.
|
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
openGUI(EntityPlayer playerEntity) |
protected void |
playGallopSound(SoundType p_190680_1_) |
protected void |
playStepSound(BlockPos pos,
Block blockIn) |
void |
readEntityFromNBT(NBTTagCompound compound)
(abstract) Protected helper method to read subclass entity data from NBT.
|
static void |
registerFixesAbstractHorse(DataFixer fixer,
java.lang.Class<?> entityClass) |
boolean |
replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn) |
void |
setBreeding(boolean breeding) |
void |
setEatingHaystack(boolean p_110227_1_) |
void |
setHorseJumping(boolean jumping) |
void |
setHorseSaddled(boolean saddled) |
void |
setHorseTamed(boolean tamed) |
protected void |
setHorseWatchableBoolean(int p_110208_1_,
boolean p_110208_2_) |
void |
setJumpPower(int jumpPowerIn) |
protected void |
setOffspringAttributes(EntityAgeable p_190681_1_,
AbstractHorse p_190681_2_) |
void |
setOwnerUniqueId(java.util.UUID uniqueId) |
void |
setRearing(boolean rearing) |
void |
setScaleForAge(boolean child)
"Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child."
|
boolean |
setTamedBy(EntityPlayer player) |
void |
setTemper(int temperIn) |
protected void |
spawnHorseParticles(boolean p_110216_1_)
"Spawns particles for the horse entity.
|
protected void |
updateHorseSlots()
Updates the items in the saddle and armor slots of the horse's inventory.
|
void |
updatePassenger(Entity passenger) |
boolean |
wearsArmor() |
void |
writeEntityToNBT(NBTTagCompound compound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
canDespawn, consumeItemFromStack, getBlockPathWeight, getCanSpawnHere, getExperiencePoints, getPlayerInLove, getYOffset, isInLove, processInteract, resetInLove, setInLove, updateAITasks
addGrowth, ageUp, getGrowingAge, holdingSpawnEggOfClass, isChild, notifyDataManagerChange, onGrowingAdult, setGrowingAge, setScale, setSize
detachHome, followLeashSpeed, getHomePosition, getMaximumHomeDistance, hasHome, hasPath, isWithinHomeDistanceCurrentPosition, isWithinHomeDistanceFromPosition, setHomePosAndDistance, updateLeashedState
canAttackClass, canEquipItem, canPassengerSteer, canPickUpLoot, clearLeashed, createBodyHelper, createNavigator, despawnEntity, dropEquipment, dropFewItems, dropLoot, eatGrassBonus, enablePersistence, faceEntity, getArmorByChance, getArmorInventoryList, getAttackTarget, getDropItem, getEntitySenses, getHeldEquipment, getHorizontalFaceSpeed, getItemStackFromSlot, getJumpHelper, getLeashed, getLeashedToEntity, getLookHelper, getLootTable, getMaxFallHeight, getMoveHelper, getNavigator, getPathPriority, getPrimaryHand, getRenderSizeModifier, getSlotForItemStack, getVerticalFaceSpeed, isAIDisabled, isItemStackInSlot, isLeftHanded, isNoDespawnRequired, isNotColliding, isServerWorld, onEntityUpdate, playHurtSound, playLivingSound, processInitialInteract, registerFixesMob, setAIMoveSpeed, setAttackTarget, setCanPickUpLoot, setDropChance, setEnchantmentBasedOnDifficulty, setEquipmentBasedOnDifficulty, setItemStackToSlot, setLeashedToEntity, setLeftHanded, setMoveForward, setMoveStrafing, setNoAI, setPathPriority, spawnExplosionParticle, startRiding, updateDistance, updateEntityActionState, updateEquipmentIfNeeded
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, areAllPotionsAmbient, attackable, attackEntityAsMob, attemptTeleport, blockUsingShield, canBeCollidedWith, canBeHitWithPotion, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, damageArmor, damageEntity, damageShield, decreaseAirSupply, dismountEntity, dismountRidingEntity, frostWalk, getAbsorptionAmount, getActiveHand, getActiveItemStack, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttackingEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getFallSound, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLastDamageSource, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSwingProgress, getTicksElytraFlying, getTotalArmorValue, getWaterSlowDown, handleJumpLava, handleJumpWater, hasItemInSlot, heal, isActiveItemStackBlocking, isElytraFlying, isEntityAlive, isEntityUndead, isHandActive, isPlayer, isPlayerSleeping, isPotionActive, isPotionApplicable, jump, kill, knockBack, markPotionsDirty, onChangedPotionEffect, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onItemUseFinish, onKillCommand, onNewPotionEffect, performHurtAnimation, playEquipSound, removeActivePotionEffect, removePotionEffect, renderBrokenItemStack, resetActiveHand, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setActiveHand, setArrowCountInEntity, setBeenAttacked, setHealth, setHeldItem, setJumping, setLastAttacker, setPositionAndRotationDirect, setRenderYawOffset, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, stopActiveHand, swingArm, updateActiveHand, updateArmSwingProgress, updateFallState, updateItemUse, updatePotionEffects, updatePotionMetadata, updateRidden
addEntityCrashInfo, addPassenger, addTag, addToPlayerScore, addTrackingPlayer, addVelocity, applyEnchantments, applyEntityCollision, applyOrientationToEntity, applyPlayerInteraction, canBeAttackedWithItem, canBeRidden, canFitPassenger, canRenderOnFire, canRiderInteract, canTrample, canTriggerWalking, canUseCommand, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getCustomNameTag, getDataManager, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getFireImmuneTicks, getFlag, getForward, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLowestRidingEntity, getMaxInPortalTime, getMirroredYaw, getMountedYOffset, getName, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getServer, getSoundCategory, getSplashSound, getSwimSound, getTags, getTeam, getTeleportDirection, getUniqueID, getVectorForRotation, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, move, moveRelative, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onCollideWithPlayer, onKillEntity, onStruckByLightning, playSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, resetEntityId, resetHeight, resetPositionToBB, sendCommandFeedback, sendMessage, serializeNBT, setAir, setAlwaysRenderNameTag, setCommandStat, setCommandStats, setCustomNameTag, setDead, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setInWeb, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRotation, setSilent, setSneaking, setUniqueId, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, toString, turn, verifyExplosion, writeToNBT, writeToNBTAtomically, writeToNBTOptional
protected static final IAttribute JUMP_STRENGTH
public int tailCounter
public int sprintCounter
protected boolean horseJumping
protected ContainerHorseChest horseChest
protected int temper
protected float jumpPower
protected boolean canGallop
protected int gallopTime
public AbstractHorse(World worldIn)
protected void initEntityAI()
initEntityAI
in class EntityLiving
protected void entityInit()
entityInit
in class EntityAgeable
protected boolean getHorseWatchableBoolean(int p_110233_1_)
protected void setHorseWatchableBoolean(int p_110208_1_, boolean p_110208_2_)
public boolean isTame()
public java.util.UUID getOwnerUniqueId()
public void setOwnerUniqueId(java.util.UUID uniqueId)
public float getHorseSize()
public void setScaleForAge(boolean child)
setScaleForAge
in class EntityAgeable
public boolean isHorseJumping()
public void setHorseTamed(boolean tamed)
public void setHorseJumping(boolean jumping)
public boolean canBeLeashedTo(EntityPlayer player)
canBeLeashedTo
in class EntityLiving
protected void onLeashDistance(float p_142017_1_)
onLeashDistance
in class EntityCreature
public boolean isEatingHaystack()
public boolean isRearing()
public boolean isBreeding()
public void setBreeding(boolean breeding)
public void setHorseSaddled(boolean saddled)
public int getTemper()
public void setTemper(int temperIn)
public int increaseTemper(int p_110198_1_)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class EntityAnimal
public boolean canBePushed()
canBePushed
in class EntityLivingBase
public void fall(float distance, float damageMultiplier)
fall
in class EntityLivingBase
protected int getInventorySize()
protected void initHorseChest()
protected void updateHorseSlots()
public void onInventoryChanged(IInventory invBasic)
onInventoryChanged
in interface IInventoryChangedListener
protected AbstractHorse getClosestHorse(Entity entityIn, double distance)
public double getHorseJumpStrength()
protected SoundEvent getDeathSound()
getDeathSound
in class EntityLivingBase
protected SoundEvent getHurtSound()
getHurtSound
in class EntityLivingBase
protected SoundEvent getAmbientSound()
getAmbientSound
in class EntityLiving
public boolean canBeSaddled()
public boolean isHorseSaddled()
protected SoundEvent getAngrySound()
protected void playStepSound(BlockPos pos, Block blockIn)
playStepSound
in class Entity
protected void playGallopSound(SoundType p_190680_1_)
protected void applyEntityAttributes()
applyEntityAttributes
in class EntityLiving
public int getMaxSpawnedInChunk()
getMaxSpawnedInChunk
in class EntityLiving
public int getMaxTemper()
protected float getSoundVolume()
getSoundVolume
in class EntityLivingBase
public int getTalkInterval()
getTalkInterval
in class EntityAnimal
public void openGUI(EntityPlayer playerEntity)
protected boolean handleEating(EntityPlayer player, ItemStack stack)
protected void mountTo(EntityPlayer player)
protected boolean isMovementBlocked()
isMovementBlocked
in class EntityLivingBase
public boolean isBreedingItem(ItemStack stack)
isBreedingItem
in class EntityAnimal
public void onDeath(DamageSource cause)
onDeath
in class EntityLivingBase
public void onLivingUpdate()
onLivingUpdate
in class EntityAnimal
protected void followMother()
public boolean canEatGrass()
public void onUpdate()
onUpdate
in class EntityLiving
public void setEatingHaystack(boolean p_110227_1_)
public void setRearing(boolean rearing)
public void makeMad()
public boolean setTamedBy(EntityPlayer player)
public void moveEntityWithHeading(float strafe, float forward)
moveEntityWithHeading
in class EntityLivingBase
public static void registerFixesAbstractHorse(DataFixer fixer, java.lang.Class<?> entityClass)
public void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT
in class EntityAnimal
public void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT
in class EntityAnimal
public boolean canMateWith(EntityAnimal otherAnimal)
canMateWith
in class EntityAnimal
protected boolean canMate()
public EntityAgeable createChild(EntityAgeable ageable)
createChild
in class EntityAgeable
protected void setOffspringAttributes(EntityAgeable p_190681_1_, AbstractHorse p_190681_2_)
public boolean canBeSteered()
canBeSteered
in class EntityLiving
public float getGrassEatingAmount(float p_110258_1_)
public float getRearingAmount(float p_110223_1_)
public float getMouthOpennessAngle(float p_110201_1_)
public void setJumpPower(int jumpPowerIn)
setJumpPower
in interface IJumpingMount
public boolean canJump()
canJump
in interface IJumpingMount
public void handleStartJump(int p_184775_1_)
handleStartJump
in interface IJumpingMount
public void handleStopJump()
handleStopJump
in interface IJumpingMount
protected void spawnHorseParticles(boolean p_110216_1_)
public void handleStatusUpdate(byte id)
handleStatusUpdate
in class EntityAnimal
public void updatePassenger(Entity passenger)
updatePassenger
in class Entity
protected float getModifiedMaxHealth()
protected double getModifiedJumpStrength()
protected double getModifiedMovementSpeed()
public boolean isOnLadder()
isOnLadder
in class EntityLivingBase
public float getEyeHeight()
getEyeHeight
in class Entity
public boolean wearsArmor()
public boolean isArmor(ItemStack stack)
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
replaceItemInInventory
in class EntityLiving
public Entity getControllingPassenger()
getControllingPassenger
in class Entity
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata)
onInitialSpawn
in class EntityLiving
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
ICapabilityProvider
getCapability
in interface ICapabilityProvider
getCapability
in class EntityLivingBase
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.hasCapability(Capability, EnumFacing)
would return false.public boolean hasCapability(Capability<?> capability, EnumFacing facing)
ICapabilityProvider
hasCapability
in interface ICapabilityProvider
hasCapability
in class EntityLivingBase
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'