Package noppes.npcs.api.entity
Interface IAnimal<T extends net.minecraft.entity.passive.EntityAnimal>
-
- Type Parameters:
T
- the underlying Minecraft EntityAnimal type.
- All Superinterfaces:
IEntity<T>
,IEntityLiving<T>
,IEntityLivingBase<T>
- All Known Subinterfaces:
IPixelmon<T>
public interface IAnimal<T extends net.minecraft.entity.passive.EntityAnimal> extends IEntityLiving<T>
Represents an animal entity with additional behavior such as breeding, following, and mating.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canMateWith(IAnimal animal)
Checks if this animal can mate with another animal.IPlayer
followingPlayer()
Returns the player that this animal is currently following.boolean
interact(IPlayer player)
Called when a player interacts with the animal.boolean
isBreedingItem(IItemStack itemStack)
Checks whether the specified item can be used to breed this animal.boolean
isInLove()
Checks if the animal is currently in a "love" state, indicating readiness to mate.void
resetInLove()
Resets the animal's love state.void
setFollowPlayer(IPlayer player)
Sets the specified player as the one to follow.-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAge, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getDimension, getEntityId, getHeight, getMotion, getMotionX, getMotionY, getMotionZ, getMount, getNbt, getNbtOptional, getPitch, getPosition, getRider, getRotation, getStoredData, getStoredDataKeys, getSurroundingEntities, getSurroundingEntities, getTempData, getTempDataKeys, getTypeName, getUniqueID, getWidth, getWorld, getX, getY, getYOffset, getZ, hasCollided, hasCollidedHorizontally, hasCollidedVertically, hasStoredData, hasTempData, inFire, inLava, inWater, isAirborne, isAlive, isBurning, isSneaking, isSprinting, knockback, knockback, knockback, removeStoredData, removeTempData, setBurning, setCapturedDrops, setCapturesDrops, setDimension, setImmune, setInvisible, setMotion, setMotion, setMotionX, setMotionY, setMotionZ, setMount, setNbt, setPitch, setPosition, setPosition, setRider, setRotation, setRotation, setSneaking, setSprinting, setStoredData, setTempData, setX, setY, setZ, spawnParticle, storeAsClone, updateEntity
-
Methods inherited from interface noppes.npcs.api.entity.IEntityLiving
allowLeashing, canBeSteered, canPickUpLoot, clearLeashed, clearNavigation, enablePersistence, faceEntity, getAlwaysRenderNameTag, getCustomNameTag, getLeashed, getLeashedTo, getMCEntity, hasCustomNameTag, isNavigating, isPersistent, navigateTo, playLivingSound, setAlwaysRenderNameTag, setCanPickUpLoot, setCustomNameTag, setLeashedTo, setMoveForward, spawnExplosionParticle
-
Methods inherited from interface noppes.npcs.api.entity.IEntityLivingBase
addPotionEffect, canBreatheUnderwater, clearPotionEffects, dismountEntity, getAbsorptionAmount, getAIMoveSpeed, getArmor, getArrowCountInEntity, getAttackTarget, getAttackTargetTime, getFollowRange, getHealth, getHeldItem, getKnockbackResistance, getLastAttacker, getLastAttackerTime, getLookingAtBlock, getLookingAtBlock, getLookingAtEntities, getLookingAtEntities, getLookingAtEntities, getLookingAtPos, getLookingAtPos, getLookVector, getMaxHealth, getMaxHurtTime, getMeleeStrength, getPotionEffect, getSpeed, getTotalArmorValue, getType, hurt, hurt, hurt, isAttacking, isChild, isOnLadder, renderBrokenItemStack, setAbsorptionAmount, setAIMoveSpeed, setArmor, setArrowCountInEntity, setAttackTarget, setFollowRange, setHealth, setHeldItem, setKnockbackResistance, setLastAttacker, setMaxHealth, setMaxHurtTime, setMeleeStrength, setSpeed, swingHand, typeOf
-
-
-
-
Method Detail
-
isBreedingItem
boolean isBreedingItem(IItemStack itemStack)
Checks whether the specified item can be used to breed this animal. (e.g. wheat, carrots or seeds depending on the animal type)- Parameters:
itemStack
- the item to test.- Returns:
- true if the item is a breeding item; false otherwise.
-
interact
boolean interact(IPlayer player)
Called when a player interacts with the animal. For example, this might return true if the player milks a cow or saddles a pig.- Parameters:
player
- the interacting player.- Returns:
- true if the interaction was handled; false otherwise.
-
setFollowPlayer
void setFollowPlayer(IPlayer player)
Sets the specified player as the one to follow.- Parameters:
player
- the player to follow.
-
followingPlayer
IPlayer followingPlayer()
Returns the player that this animal is currently following.- Returns:
- the following player, or null if not following anyone.
-
isInLove
boolean isInLove()
Checks if the animal is currently in a "love" state, indicating readiness to mate.- Returns:
- true if the animal is in love; false otherwise.
-
resetInLove
void resetInLove()
Resets the animal's love state.
-
canMateWith
boolean canMateWith(IAnimal animal)
Checks if this animal can mate with another animal.- Parameters:
animal
- the other animal.- Returns:
- true if mating is possible; false otherwise.
-
-