public abstract class NPCEntity
extends net.minecraft.entity.CreatureEntity
implements net.minecraft.entity.INPC
Modifier and Type | Field and Description |
---|---|
protected int |
chatIndex
The random index to get the NPC's default messages from.
|
protected EntityDataSyncManager |
dataSyncManager |
int |
despawnCounter
The despawn counter for the NPC.
|
java.util.ArrayList<java.lang.String> |
interactCommands
Commands to execute when the Player forfeits.
|
static int |
intMaxTicksToDespawn
The maximum number of ticks to wait before despawning the NPC.
|
static int |
intMinTicksToDespawn
The minimum number of ticks to wait before despawning the NPC.
|
SpawnLocationType |
npcLocation
The NPC's spawn location.
|
static net.minecraft.util.math.vector.Vector3f |
ONE |
static net.minecraft.util.math.vector.Vector3f |
SMALLER |
static DataSync<NPCEntity,java.lang.String> |
SYNC_CUSTOM_STEVE_TEXTURE |
static DataSync<NPCEntity,BaseTrainer> |
SYNC_MODEL |
static DataSync<NPCEntity,java.lang.String> |
SYNC_NAME |
static DataSync<NPCEntity,java.lang.String> |
SYNC_NICKNAME |
static DataSync<NPCEntity,java.lang.Integer> |
SYNC_PROFESSION |
static DataSync<NPCEntity,java.lang.Integer> |
SYNC_TEXTURE_INDEX |
static int |
TICKSPERSECOND
The number of ticks per second in Minecraft.
|
protected BaseTrainer |
trainer |
ambientSoundTime, armorDropChances, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector, xpReward
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_HEALTH_ID, 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, noJumpDelay, oAttackAnim, oRun, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, timeOffs, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
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, type, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
Constructor and Description |
---|
NPCEntity(net.minecraft.entity.EntityType<? extends NPCEntity> type,
net.minecraft.world.World world)
Initializes the NPC and its data watcher attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt) |
boolean |
bindTexture()
Binds a texture to the NPC.
|
boolean |
canBeLeashed(net.minecraft.entity.player.PlayerEntity player) |
protected void |
checkForRarityDespawn()
Keeps track of when to despawn the NPC.
|
boolean |
checkSpawnRules(net.minecraft.world.IWorld p_213380_1_,
net.minecraft.entity.SpawnReason p_213380_2_) |
protected void |
customServerAiStep()
Randomly changes the NPC's current action.
|
protected <A> void |
define(DataSync<?,A> sync,
A value) |
protected void |
defineSynchedData() |
EnumTrainerAI |
getAIMode()
Gets the tutor's AI mode.
|
BaseTrainer |
getBaseTrainer()
Gets the base NPC Trainer data from the NPC.
|
BossTier |
getBossTier()
Gets the boss tier of the NPC.
|
java.lang.String |
getCustomSteveTexture()
Gets the NPC's Steve texture.
|
abstract java.lang.String |
getDisplayText()
Gets the text that displays above the NPC.
|
int |
getMaxSpawnClusterSize() |
net.minecraft.util.math.vector.Vector3f |
getModelScale()
Gets the scale of the NPC's model.
|
net.minecraft.util.text.ITextComponent |
getName()
Gets the NPC's name.
|
java.lang.String |
getNickName() |
int |
getNPCID()
Gets the NPC's ID.
|
net.minecraft.inventory.Inventory |
getNPCInventory()
Gets the NPC's inventory.
|
int |
getProfession()
Gets the ID of the NPC's profession.
|
java.lang.String |
getSubTitleText()
Gets the subtitle for the text that displays above the NPC.
|
java.lang.String |
getTexture()
Gets the NPC's texture.
|
int |
getTextureIndex()
Gets the texture index of the NPC.
|
boolean |
hasItemToPlant()
Checks if the NPC can plant an item.
|
boolean |
hurt(net.minecraft.util.DamageSource par1DamageSource,
float par2) |
void |
init(java.lang.String name)
Initializes the NPC with its name and health.
|
void |
initAI()
Initializes the NPC's AI.
|
void |
initDefaultAI()
Initializes the NPC's AI to stand still.
|
void |
initVilagerAI()
Initializes the NPC's AI to act like a villager.
|
void |
initWanderingAI()
Initializes the NPC's AI to wander.
|
net.minecraft.util.ActionResultType |
interactAt(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.math.vector.Vector3d vector,
net.minecraft.util.Hand hand) |
boolean |
interactWithNPC(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
Handles a player interacting with the NPC.
|
boolean |
isFarmItemInInventory()
Returns true if the NPC has seeds, potatoes or carrots in its inventory.
|
boolean |
isPushable() |
static <T extends NPCEntity> |
locateNPCClient(net.minecraft.world.World world,
int id,
java.lang.Class<T> type)
Finds the NPC in the world from its ID.
|
static <T extends NPCEntity> |
locateNPCServer(net.minecraft.world.World world,
int id,
java.lang.Class<T> type) |
static <T extends NPCEntity> |
locateNPCServer(net.minecraft.world.World world,
java.lang.String name,
java.lang.Class<T> type,
java.lang.String langCode)
Finds an NPC from its name.
|
void |
onSyncedDataUpdated(net.minecraft.network.datasync.DataParameter<?> key) |
protected void |
pickUpItem(net.minecraft.entity.item.ItemEntity itemEntity)
Tests if this entity should pick up a weapon or an armor.
|
protected boolean |
playersNearby()
Checks whether there are players near the NPC.
|
void |
readAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt) |
boolean |
removeWhenFarAway(double p_213397_1_) |
boolean |
save(net.minecraft.nbt.CompoundNBT p_70039_1_) |
void |
setAIMode(EnumTrainerAI mode)
Sets the Trainer's AI mode.
|
void |
setBaseTrainer(BaseTrainer trainer)
Sets the base NPC Trainer data for the NPC.
|
void |
setCustomSteveTexture(java.lang.String tex)
Sets the NPC's Steve texture.
|
void |
setName(java.lang.String name)
Sets the NPC's name.
|
void |
setNickName(java.lang.String nickName) |
void |
setProfession(int professionId)
Sets the NPC's profession.
|
boolean |
setSlot(int inventorySlot,
net.minecraft.item.ItemStack itemStackIn) |
void |
setTextureIndex(int index)
Sets the texture index of the NPC.
|
boolean |
shouldSave() |
void |
tick() |
void |
unloadEntity()
Despawns the NPC.
|
followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
aiStep, ate, baseTick, canAttack, canAttackType, canBeControlledByRider, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkAndHandleImportantInteractions, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getEquipmentSlotForItem, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMoveControl, getNavigation, getPathfindingMalus, getRestrictCenter, getRestrictRadius, getSensing, getTarget, handleEntityEvent, hasRestriction, interact, isAggressive, isControlledByLocalInstance, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSunBurnTick, isValidSlotForItem, isWithinRestriction, isWithinRestriction, jumpInLiquid, lookAt, mobInteract, onOffspringSpawnedFromEgg, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBaby, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tickHeadTurn, updateControlFlags, wantsToPickUp
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, getDeathSound, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEyeHeight, getFallDamageSound, getFallFlyingTicks, getFeetBlockState, getFluidFallingAdjustedMovement, getHealth, getHurtSound, getItemInHand, getJumpPower, getKillCredit, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRandom, getRelativePortalPosition, getScale, getSleepingPos, getSoundVolume, getSpeed, getStandingEyeHeight, 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, isBaby, isBlocking, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, 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, updateFallFlying, updateInvisibilityStatus, updateSwingTime
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, getMyRidingOffset, 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, 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, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rotate, 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
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final net.minecraft.util.math.vector.Vector3f ONE
public static final net.minecraft.util.math.vector.Vector3f SMALLER
public static final int TICKSPERSECOND
public static int intMinTicksToDespawn
public static int intMaxTicksToDespawn
public static final DataSync<NPCEntity,BaseTrainer> SYNC_MODEL
public static final DataSync<NPCEntity,java.lang.String> SYNC_CUSTOM_STEVE_TEXTURE
protected BaseTrainer trainer
public SpawnLocationType npcLocation
public int despawnCounter
protected int chatIndex
public java.util.ArrayList<java.lang.String> interactCommands
protected EntityDataSyncManager dataSyncManager
public NPCEntity(net.minecraft.entity.EntityType<? extends NPCEntity> type, net.minecraft.world.World world)
type
- The entity type.world
- The world to spawn the NPC in.protected void defineSynchedData()
defineSynchedData
in class net.minecraft.entity.MobEntity
protected <A> void define(DataSync<?,A> sync, A value)
public void init(java.lang.String name)
name
- The NPC's name.public java.lang.String getNickName()
public void setNickName(java.lang.String nickName)
public java.lang.String getTexture()
public java.lang.String getCustomSteveTexture()
public void setCustomSteveTexture(java.lang.String tex)
tex
- The new Steve texture.public boolean removeWhenFarAway(double p_213397_1_)
removeWhenFarAway
in class net.minecraft.entity.MobEntity
public net.minecraft.util.text.ITextComponent getName()
getName
in interface net.minecraft.util.INameable
getName
in class net.minecraft.entity.Entity
public void setName(java.lang.String name)
name
- The NPC's name.public boolean hurt(net.minecraft.util.DamageSource par1DamageSource, float par2)
hurt
in class net.minecraft.entity.LivingEntity
public boolean isPushable()
isPushable
in class net.minecraft.entity.LivingEntity
public boolean canBeLeashed(net.minecraft.entity.player.PlayerEntity player)
canBeLeashed
in class net.minecraft.entity.MobEntity
public boolean save(net.minecraft.nbt.CompoundNBT p_70039_1_)
save
in class net.minecraft.entity.Entity
public boolean shouldSave()
public void addAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt)
addAdditionalSaveData
in class net.minecraft.entity.MobEntity
public void readAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt)
readAdditionalSaveData
in class net.minecraft.entity.MobEntity
public void initAI()
public boolean checkSpawnRules(net.minecraft.world.IWorld p_213380_1_, net.minecraft.entity.SpawnReason p_213380_2_)
checkSpawnRules
in class net.minecraft.entity.CreatureEntity
public net.minecraft.util.ActionResultType interactAt(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.math.vector.Vector3d vector, net.minecraft.util.Hand hand)
interactAt
in class net.minecraft.entity.Entity
public boolean interactWithNPC(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand)
player
- The player interacting with the NPC.public int getMaxSpawnClusterSize()
getMaxSpawnClusterSize
in class net.minecraft.entity.MobEntity
public int getNPCID()
public abstract java.lang.String getDisplayText()
public java.lang.String getSubTitleText()
public BossTier getBossTier()
public BaseTrainer getBaseTrainer()
public void setBaseTrainer(BaseTrainer trainer)
trainer
- The new base NPC Trainer data.public boolean bindTexture()
public net.minecraft.util.math.vector.Vector3f getModelScale()
public static <T extends NPCEntity> java.util.Optional<T> locateNPCClient(net.minecraft.world.World world, int id, java.lang.Class<T> type)
world
- The world the NPC is in.id
- The ID of the NPC.public static <T extends NPCEntity> java.util.Optional<T> locateNPCServer(net.minecraft.world.World world, int id, java.lang.Class<T> type)
public static <T extends NPCEntity> java.util.Optional<T> locateNPCServer(net.minecraft.world.World world, java.lang.String name, java.lang.Class<T> type, java.lang.String langCode)
world
- The world that the NPC is in.name
- The name of the NPC.type
- The type of NPC to find.langCode
- The language code of the player searching for an NPC.public void unloadEntity()
public int getTextureIndex()
public void setTextureIndex(int index)
index
- The texture index of the NPC.public void tick()
tick
in class net.minecraft.entity.MobEntity
protected void checkForRarityDespawn()
protected boolean playersNearby()
public void setProfession(int professionId)
professionId
- The ID of the profession to set the NPC to.public int getProfession()
public void initDefaultAI()
public void initWanderingAI()
public void initVilagerAI()
public boolean isFarmItemInInventory()
public boolean setSlot(int inventorySlot, net.minecraft.item.ItemStack itemStackIn)
setSlot
in class net.minecraft.entity.MobEntity
public boolean hasItemToPlant()
public net.minecraft.inventory.Inventory getNPCInventory()
protected void pickUpItem(net.minecraft.entity.item.ItemEntity itemEntity)
pickUpItem
in class net.minecraft.entity.MobEntity
protected void customServerAiStep()
customServerAiStep
in class net.minecraft.entity.MobEntity
public EnumTrainerAI getAIMode()
public void setAIMode(EnumTrainerAI mode)
mode
- The new AI mode.public void onSyncedDataUpdated(net.minecraft.network.datasync.DataParameter<?> key)
onSyncedDataUpdated
in class net.minecraft.entity.LivingEntity