Package net.minecraft.entity.passive
Class SheepEntity
- java.lang.Object
-
- All Implemented Interfaces:
ICommandSource
,IShearable
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeEntity
,IForgeShearable
,INBTSerializable<CompoundNBT>
public class SheepEntity extends AnimalEntity implements IShearable, IForgeShearable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.entity.AgeableEntity
AgeableEntity.AgeableData
-
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<DyeColor,float[]>
COLORARRAY_BY_COLOR
private static DataParameter<java.lang.Byte>
DATA_WOOL_ID
private int
eatAnimationTick
private EatGrassGoal
eatBlockGoal
private static java.util.Map<DyeColor,IItemProvider>
ITEM_BY_DYE
-
Fields inherited from class net.minecraft.entity.AgeableEntity
age, forcedAge, forcedAgeTimer
-
Fields inherited from class net.minecraft.entity.MobEntity
ambientSoundTime, armorDropChances, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector, xpReward
-
Fields inherited from class net.minecraft.entity.LivingEntity
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, deathScore, deathTime, fallFlyTicks, flyingSpeed, hurtDir, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, lyHeadRot, noActionTime, oAttackAnim, oRun, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, timeOffs, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
-
Fields inherited from class net.minecraft.entity.Entity
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, ENTITY_COUNTER, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
-
Fields inherited from interface net.minecraft.command.ICommandSource
NULL
-
-
Constructor Summary
Constructors Constructor Description SheepEntity(EntityType<? extends SheepEntity> p_i50245_1_, World p_i50245_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalSaveData(CompoundNBT p_213281_1_)
void
aiStep()
void
ate()
static AttributeModifierMap.MutableAttribute
createAttributes()
private static float[]
createSheepColor(DyeColor p_192020_0_)
protected void
customServerAiStep()
protected void
defineSynchedData()
ILivingEntityData
finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, ILivingEntityData p_213386_4_, CompoundNBT p_213386_5_)
protected SoundEvent
getAmbientSound()
SheepEntity
getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
DyeColor
getColor()
static float[]
getColorArray(DyeColor p_175513_0_)
protected SoundEvent
getDeathSound()
ResourceLocation
getDefaultLootTable()
float
getHeadEatAngleScale(float p_70890_1_)
float
getHeadEatPositionScale(float p_70894_1_)
protected SoundEvent
getHurtSound(DamageSource p_184601_1_)
private DyeColor
getOffspringColor(AnimalEntity p_175511_1_, AnimalEntity p_175511_2_)
static DyeColor
getRandomSheepColor(java.util.Random p_175510_0_)
protected float
getStandingEyeHeight(Pose p_213348_1_, EntitySize p_213348_2_)
void
handleEntityEvent(byte p_70103_1_)
boolean
isShearable(ItemStack item, World world, BlockPos pos)
Checks if the object is currently shearable Example: Sheep return false when they have no woolboolean
isSheared()
private static CraftingInventory
makeContainer(DyeColor p_213611_0_, DyeColor p_213611_1_)
ActionResultType
mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
java.util.List<ItemStack>
onSheared(PlayerEntity player, ItemStack item, World world, BlockPos pos, int fortune)
Performs the shear function on this object.protected void
playStepSound(BlockPos p_180429_1_, BlockState p_180429_2_)
void
readAdditionalSaveData(CompoundNBT p_70037_1_)
boolean
readyForShearing()
protected void
registerGoals()
void
setColor(DyeColor p_175512_1_)
void
setSheared(boolean p_70893_1_)
void
shear(SoundCategory p_230263_1_)
-
Methods inherited from class net.minecraft.entity.passive.AnimalEntity
canFallInLove, canMate, checkAnimalSpawnRules, getAmbientSoundInterval, getExperienceReward, getInLoveTime, getLoveCause, getMyRidingOffset, getWalkTargetValue, hurt, isFood, isInLove, removeWhenFarAway, resetLove, setInLove, setInLoveTime, spawnChildFromBreeding, usePlayerItem
-
Methods inherited from class net.minecraft.entity.AgeableEntity
ageBoundaryReached, ageUp, ageUp, canBreed, getAge, isBaby, onSyncedDataUpdated, setAge, setBaby
-
Methods inherited from class net.minecraft.entity.CreatureEntity
checkSpawnRules, followLeashSpeed, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
-
Methods inherited from class net.minecraft.entity.MobEntity
baseTick, canAttack, canAttackType, canBeControlledByRider, canBeLeashed, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, getArmorSlots, getEquipmentDropChance, getEquipmentForSlot, getEquipmentSlotForItem, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getNavigation, getPathfindingMalus, getRestrictCenter, getRestrictRadius, getSensing, getTarget, hasRestriction, interact, isAggressive, isControlledByLocalInstance, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSunBurnTick, isValidSlotForItem, isWithinRestriction, isWithinRestriction, jumpInLiquid, lookAt, onOffspringSpawnedFromEgg, pickUpItem, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, removeAfterChangingDimensions, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSlot, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tick, tickHeadTurn, updateControlFlags, wantsToPickUp
-
Methods inherited from class net.minecraft.entity.LivingEntity
actuallyHurt, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canBeAffected, canBreatheUnderwater, canSee, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, decreaseAirSupply, die, doAutoAttackOnTouch, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAddEntityPacket, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCapability, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEyeHeight, getFallDamageSound, getFallFlyingTicks, getFeetBlockState, getFluidFallingAdjustedMovement, getHealth, getItemInHand, getJumpPower, getKillCredit, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRandom, getRelativePortalPosition, getScale, getSleepingPos, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, heal, hurtArmor, hurtCurrentlyUsedShield, increaseAirSupply, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadTo, lerpTo, lookAt, makeBrain, markHurt, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onItemPickup, onLeaveCombat, onSoulSpeedBlock, outOfWorld, playBlockFallSound, playEquipSound, push, pushEntities, randomTeleport, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, rideableUnderWater, rideTick, setAbsorptionAmount, setArrowCount, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setOnGround, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, spawnSoulSpeedParticle, startAutoSpinAttack, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, travel, triggerItemUseEffects, tryAddSoulSpeed, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime
-
Methods inherited from class net.minecraft.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMotionDirection, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersRidingOffset, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getY, getY, getZ, getZ, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isMovementNoisy, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killed, lavaHurt, lerpMotion, limitPistonMovement, load, makeFlySound, makeStuckInBlock, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, pick, playerTouch, playFlySound, playSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setLevel, setLocationFromBoundingbox, setNoGravity, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSwimming, setUUID, setViewScale, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
-
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
-
-
-
-
Field Detail
-
DATA_WOOL_ID
private static final DataParameter<java.lang.Byte> DATA_WOOL_ID
-
ITEM_BY_DYE
private static final java.util.Map<DyeColor,IItemProvider> ITEM_BY_DYE
-
COLORARRAY_BY_COLOR
private static final java.util.Map<DyeColor,float[]> COLORARRAY_BY_COLOR
-
eatAnimationTick
private int eatAnimationTick
-
eatBlockGoal
private EatGrassGoal eatBlockGoal
-
-
Constructor Detail
-
SheepEntity
public SheepEntity(EntityType<? extends SheepEntity> p_i50245_1_, World p_i50245_2_)
-
-
Method Detail
-
createSheepColor
private static float[] createSheepColor(DyeColor p_192020_0_)
-
getColorArray
public static float[] getColorArray(DyeColor p_175513_0_)
-
registerGoals
protected void registerGoals()
- Overrides:
registerGoals
in classMobEntity
-
customServerAiStep
protected void customServerAiStep()
- Overrides:
customServerAiStep
in classAnimalEntity
-
aiStep
public void aiStep()
- Overrides:
aiStep
in classAnimalEntity
-
createAttributes
public static AttributeModifierMap.MutableAttribute createAttributes()
-
defineSynchedData
protected void defineSynchedData()
- Overrides:
defineSynchedData
in classAgeableEntity
-
getDefaultLootTable
public ResourceLocation getDefaultLootTable()
- Overrides:
getDefaultLootTable
in classMobEntity
-
handleEntityEvent
public void handleEntityEvent(byte p_70103_1_)
- Overrides:
handleEntityEvent
in classAnimalEntity
-
getHeadEatPositionScale
public float getHeadEatPositionScale(float p_70894_1_)
-
getHeadEatAngleScale
public float getHeadEatAngleScale(float p_70890_1_)
-
mobInteract
public ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
- Overrides:
mobInteract
in classAnimalEntity
-
shear
public void shear(SoundCategory p_230263_1_)
- Specified by:
shear
in interfaceIShearable
-
readyForShearing
public boolean readyForShearing()
- Specified by:
readyForShearing
in interfaceIShearable
-
addAdditionalSaveData
public void addAdditionalSaveData(CompoundNBT p_213281_1_)
- Overrides:
addAdditionalSaveData
in classAnimalEntity
-
readAdditionalSaveData
public void readAdditionalSaveData(CompoundNBT p_70037_1_)
- Overrides:
readAdditionalSaveData
in classAnimalEntity
-
getAmbientSound
protected SoundEvent getAmbientSound()
- Overrides:
getAmbientSound
in classMobEntity
-
getHurtSound
protected SoundEvent getHurtSound(DamageSource p_184601_1_)
- Overrides:
getHurtSound
in classLivingEntity
-
getDeathSound
protected SoundEvent getDeathSound()
- Overrides:
getDeathSound
in classLivingEntity
-
playStepSound
protected void playStepSound(BlockPos p_180429_1_, BlockState p_180429_2_)
- Overrides:
playStepSound
in classEntity
-
getColor
public DyeColor getColor()
-
setColor
public void setColor(DyeColor p_175512_1_)
-
isSheared
public boolean isSheared()
-
setSheared
public void setSheared(boolean p_70893_1_)
-
getRandomSheepColor
public static DyeColor getRandomSheepColor(java.util.Random p_175510_0_)
-
getBreedOffspring
public SheepEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
- Specified by:
getBreedOffspring
in classAgeableEntity
-
finalizeSpawn
@Nullable public ILivingEntityData finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, @Nullable ILivingEntityData p_213386_4_, @Nullable CompoundNBT p_213386_5_)
- Overrides:
finalizeSpawn
in classAgeableEntity
-
getOffspringColor
private DyeColor getOffspringColor(AnimalEntity p_175511_1_, AnimalEntity p_175511_2_)
-
makeContainer
private static CraftingInventory makeContainer(DyeColor p_213611_0_, DyeColor p_213611_1_)
-
getStandingEyeHeight
protected float getStandingEyeHeight(Pose p_213348_1_, EntitySize p_213348_2_)
- Overrides:
getStandingEyeHeight
in classLivingEntity
-
isShearable
public boolean isShearable(@Nonnull ItemStack item, World world, BlockPos pos)
Description copied from interface:IForgeShearable
Checks if the object is currently shearable Example: Sheep return false when they have no wool- Specified by:
isShearable
in interfaceIForgeShearable
- Parameters:
item
- The ItemStack that is being used, may be empty.world
- The current world.pos
- Block's position in world.- Returns:
- If this is shearable, and onSheared should be called.
-
onSheared
@Nonnull public java.util.List<ItemStack> onSheared(@Nullable PlayerEntity player, @Nonnull ItemStack item, World world, BlockPos pos, int fortune)
Description copied from interface:IForgeShearable
Performs the shear function on this object. This is called for both client, and server. The object should perform all actions related to being sheared, except for dropping of the items, and removal of the block. As those are handled by ItemShears itself. Returns a list of items that resulted from the shearing process. For entities, they should trust there internal location information over the values passed into this function.- Specified by:
onSheared
in interfaceIForgeShearable
item
- The ItemStack that is being used, may be empty.world
- The current world.pos
- If this is a block, the block's position in world.fortune
- The fortune level of the shears being used.- Returns:
- A List containing all items from this shearing. May be empty.
-
-