Package noppes.npcs.api.entity
Interface ICustomNpc<T extends net.minecraft.entity.EntityCreature>
-
- Type Parameters:
T- the underlying EntityCreature type.
- All Superinterfaces:
IAnimatable,IEntity<T>,IEntityLiving<T>,IEntityLivingBase<T>
public interface ICustomNpc<T extends net.minecraft.entity.EntityCreature> extends IEntityLiving<T>, IAnimatable
Represents a customizable NPC with a wide variety of properties such as appearance, behavior, combat, loot, and more. This interface extends living entity and animation capabilities and defines methods for adjusting almost every aspect of an NPC.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaimWhileShooting(boolean aimWhileShooting)Deprecated.booleancanAimWhileShooting()Deprecated.booleancanBreathe()Returns whether the NPC can breathe.booleancanFly()Returns whether the NPC can fly.voidexecuteCommand(String command)Executes a command as the NPC.IDataAbilitiesgetAbilityData()Returns the Ability Data of an NPC.intgetAccuracy()Returns the shooting accuracy.IActionManagergetActionManager()Returns the action manager used for scheduling NPC actions.IEnergyProjectile[]getActiveEnergyProjectiles()Returns all active energy projectiles fired by this NPC.longgetAge()Returns the age of the NPC in ticks.intgetAggroRange()Returns the aggro range of the NPC.bytegetAimType()Gets the Aim Type for an NPCStringgetAngrySound()Returns the NPC's angry/aggro sound resource path.IAnimationDatagetAnimationData()Returns the NPC's animation data.IItemStackgetArmor(int slot)Returns the armor item in the specified slot.floatgetArrowResistance()Returns the NPC's arrow resistance.booleangetAttackFactions()Returns whether the NPC attacks other factions.booleangetAttackInvisible()Returns whether the NPC can attack invisible targets.ILinesgetAttackLines()Returns the lines spoken when the NPC attacks.booleangetAvoidsSun()Returns whether the NPC avoids sunlight.booleangetAvoidsWater()Returns whether the NPC avoids water.floatgetBodyOffsetX()Returns the NPC's body X offset.floatgetBodyOffsetY()Returns the NPC's body Y offset.floatgetBodyOffsetZ()Returns the NPC's body Z offset.booleangetBurnInSun()Returns whether the NPC burns in sunlight.intgetBurstCount()Returns the number of shots in a burst.booleangetCanDrown()Returns whether the NPC can drown.intgetCanFireIndirect()Returns whether the NPC fires indirect (arcing) projectiles.booleangetCanSprint()Returns whether the NPC can sprint.booleangetCanSwim()Returns whether the NPC can swim.StringgetCloakTexture()Returns the NPC's cloak texture.intgetCollisionType()Returns the NPC's collision type.intgetCombatPolicy()Returns the NPC's combat policy.StringgetCombatPolicyName()Returns the name of the NPC's combat policy.floatgetCombatRegen()Returns the NPC's combat health regeneration per second.intgetCreatureType()Returns the NPC's creature type.booleangetDamageDisabled()Returns whether all damage to this NPC is disabled.StringgetDeathSound()Returns the NPC's death sound resource path.booleangetDefendFaction()Returns whether the NPC defends its faction.IDialoggetDialog(int slot)Retrieves the dialog from the specified slot.intgetDialogId(int slot)Returns the dialog ID in the specified slot.booleangetDirectLOS()Returns whether the NPC requires direct line-of-sight to attack.booleangetDisablePitch()Returns whether pitch variation is disabled for NPC sounds.intgetDistanceToMelee()Returns the distance at which the NPC switches from ranged to melee.intgetDoorInteract()Returns the NPC's door interaction behavior.floatgetExplosionResistance()Returns the NPC's explosion resistance.IFactiongetFaction()Returns the faction associated with the NPC.intgetFireRate()Returns the fire rate for ranged attacks.StringgetFireSound()Returns the sound directory played when a projectile is fired.doublegetFlyGravity(double unused)Returns the gravity effect on the NPC while flying.intgetFlyHeightLimit(int unused)Returns the maximum flying height for the NPC.doublegetFlySpeed(double unused)Returns the NPC's flying speed.StringgetGlowTexture()Returns the NPC's glow texture path.floatgetHealthRegen()Returns the NPC's health regeneration per second when not in combat.booleangetHideKilledBody()Returns whether the NPC's body is hidden upon death.IHitboxDatagetHitboxData()Returns the hitbox data associated with the NPC.IPosgetHome()Returns the NPC's home position.intgetHomeX()Returns the home position X coordinate.intgetHomeY()Returns the home position Y coordinate.intgetHomeZ()Returns the home position Z coordinate.StringgetHurtSound()Returns the NPC's hurt sound resource path.StringgetIdleSound()Returns the NPC's idle sound resource path.booleangetIgnoreCobweb()Returns whether the NPC ignores cobwebs.booleangetImmuneToFire()Returns whether the NPC is immune to fire.ILinesgetInteractLines()Returns the lines used for NPC interaction.IJobgetJob()Returns the NPC's current job.ILinesgetKilledLines()Returns the lines spoken when the NPC is killed.ILinesgetKillLines()Returns the lines spoken when the NPC kills another entity.intgetKnockback()Returns the knockback strength of the NPC.doublegetKnockbackResistance()Returns the NPC's knockback resistance.intgetLeapType()Returns the NPC's leap attack type.IItemStackgetLeftItem()Returns the item held in the NPC's left hand.IItemStackgetLefttItem()Deprecated.doublegetLootChance(int slot)Returns the chance for the loot item in the specified slot to drop.IItemStackgetLootItem(int slot)Returns the loot item from the NPC's drop list for the given slot.intgetLootMode()Returns the NPC's loot mode.IMagicDatagetMagicData()Returns the Magic Data of an NPCintgetMaxLootXP()Returns the maximum XP dropped by the NPC.intgetMaxProjectileDelay()Returns the maximum projectile delay.intgetMeleeRange()Returns the melee range of the NPC.floatgetMeleeResistance()Returns the NPC's melee resistance.intgetMeleeSpeed()Returns the melee speed of the NPC.doublegetMeleeStrength()Returns the melee strength of the NPC.intgetMinLootXP()Returns the minimum XP dropped by the NPC.intgetMinPointsToSoulStone()Returns the minimum faction points required to capture the NPC with a soul stone.intgetMinProjectileDelay()Returns the minimum projectile delay.IModelDatagetModelData()Returns the model data associated with the NPC.intgetModelType()Returns the NPC's model type.intgetMovingPattern()Returns the NPC's path movement pattern.booleangetMovingPause()Returns whether the NPC pauses at path points.intgetMovingType()Returns the moving type of the NPC.StringgetName()Returns the NPC's name.booleangetNoFallDamage()Returns whether the NPC takes no fall damage.booleangetNpcInteracting()Returns whether the NPC interacts with other NPCs.booleangetOrderedLines()Returns whether NPC dialog lines are played in order.IOverlayHandlergetOverlays()Returns the NPC's overlay handler.StringgetOverlayTexture()Returns the first overlay texture of the NPC.booleangetPotionImmune()Returns whether the NPC is immune to potion effects.booleangetProjectileInvincibility()Returns whether the NPC has projectile invincibility frames.IItemStackgetProjectileItem()Returns the projectile item used by the NPC.booleangetProjectilesKeepTerrain()Returns whether projectiles fired by the NPC ignore terrain collisions.intgetRangedBurst()Returns the number of projectiles in a ranged burst attack.intgetRangedRange()Returns the range for ranged attacks.intgetRangedSpeed()Returns the ranged attack speed of the NPC.floatgetRangedStrength()Returns the ranged attack strength of the NPC.booleangetReactsToFire()Returns whether the NPC reacts to fire.booleangetRefuseSoulStone()Returns whether the NPC refuses to be captured by a soul stone.intgetRespawnCycle()Returns the NPC's respawn cycle.intgetRespawnTime()Returns the number of ticks before the NPC respawns.booleangetReturnToHome()Returns whether the NPC is set to return home.IItemStackgetRightItem()Returns the item held in the NPC's right hand.IRolegetRole()Returns the NPC's current role.intgetRotationType()Returns the NPC's rotation type.intgetShelterFrom()Returns the condition under which the NPC seeks shelter.intgetShotCount()Returns the number of shots fired.intgetShowBossBar()Returns the visibility type of the NPC's boss bar.intgetShowName()Returns the visibility type of the NPC's name.intgetSize()Returns the current NPC's size (scale factor) within the range 1–30.bytegetSkinType()Returns the NPC's skin type.StringgetSkinUrl()Returns the NPC's skin URL.StringgetSoulStonePlayerName()Returns the name of the player who spawned this NPC using a soul stone.doublegetSpeed()Returns the NPC's walking speed.StringgetStepSound()Returns the NPC's step/footstep sound resource path.booleangetStopAndInteract()Returns whether the NPC stops moving to interact with players.intgetSwingWarmup()Returns the swing warmup time (in ticks) before melee damage is applied.intgetTacticalChance()Returns the tactical behavior chance (1 in N).intgetTacticalRadius()Returns the tactical radius affecting NPC behavior.intgetTacticalVariant()Returns the NPC's tactical variant.StringgetTacticalVariantName()Returns the name of the NPC's tactical variant.StringgetTexture()Returns the NPC's texture path.ITimersgetTimers()Returns the timers associated with the NPC.ITintDatagetTintData()Returns the tint data associated with the NPC.StringgetTitle()Returns the NPC's title.intgetType()Returns the entity type of the NPC.intgetUseRangeMelee()Returns the NPC's use-range-melee mode.intgetVisibleType()Returns the visibility type of the NPC.intgetWalkingRange()Returns the NPC's walking range (wander radius).ILinesgetWorldLines()Returns the lines displayed in the world.voidgiveItem(IPlayer player, IItemStack item)Gives an item to the specified player.booleanhasLivingAnimation()Returns whether the NPC has a living animation.voidhideKilledBody(boolean hide)Sets whether the NPC's body should be hidden upon death.booleanisFlyHeightLimited(boolean unused)Checks if flying height is limited.booleanisSoulStoneInit()Returns whether the NPC has been initialized after a soul stone spawn.booleanisVisibleTo(IPlayer player)Checks if the NPC is visible to a specific player.voidkill()Kills the NPC without despawning it.voidlimitFlyHeight(boolean limit)Enables or disables flying height limitation.booleannaturallyDespawns()Returns whether the NPC naturally despawns.intonFoundEnemy()Returns the NPC's behavior when encountering an enemy.voidreset()Resets the NPC to its initial state and triggers the initialization script.voidsay(String message)Makes the NPC broadcast a message.voidsay(IPlayer player, String message)Makes the NPC send a message to a specific player.voidsetAccuracy(int accuracy)Sets the shooting accuracy.voidsetAggroRange(int aggroRange)Sets the aggro range of the NPC.voidsetAimType(byte aimWhileShooting)Sets the Aim Type for an NPCvoidsetAngrySound(String sound)Sets the NPC's angry/aggro sound resource path.voidsetAnimation(int type)Sets the NPC's animation type.voidsetArmor(int slot, IItemStack item)Sets the armor item in the specified slot.voidsetArmsScale(float x, float y, float z)Deprecated.voidsetArrowResistance(float resistance)Sets the NPC's arrow resistance.voidsetAttackFactions(boolean attackOtherFactions)Sets whether the NPC will attack members of other factions.voidsetAttackInvisible(boolean attackInvisible)Sets whether the NPC can attack invisible targets.voidsetAvoidsSun(boolean avoidsSun)Sets whether the NPC avoids sunlight.voidsetAvoidsWater(boolean avoidsWater)Sets whether the NPC avoids water.voidsetBodyOffsetX(float offsetX)Sets the NPC's body X offset.voidsetBodyOffsetY(float offsetY)Sets the NPC's body Y offset.voidsetBodyOffsetZ(float offsetZ)Sets the NPC's body Z offset.voidsetBodyScale(float x, float y, float z)Deprecated.voidsetBurnInSun(boolean burnInSun)Sets whether the NPC burns in sunlight.voidsetBurstCount(int burstCount)Sets the number of shots in a burst.voidsetCanDrown(boolean canDrown)Sets whether the NPC can drown.voidsetCanFireIndirect(int canFireIndirect)Sets whether the NPC fires indirect (arcing) projectiles.voidsetCanSprint(boolean canSprint)Sets whether the NPC can sprint.voidsetCanSwim(boolean canSwim)Sets whether the NPC can swim.voidsetCloakTexture(String cloakTexture)Sets the NPC's cloak texture.voidsetCollisionType(int type)Sets the NPC's collision type.voidsetCombatPolicy(int policy)Sets the NPC's combat policy.voidsetCombatPolicy(String policy)Sets the NPC's combat policy by name.voidsetCombatRegen(float regen)Sets the NPC's combat health regeneration per second.voidsetCreatureType(int type)Sets the NPC's creature type.voidsetDamageDisabled(boolean disabled)Sets whether all damage to this NPC is disabled.voidsetDeathSound(String sound)Sets the NPC's death sound resource path.voidsetDefendFaction(boolean defendFaction)Sets whether the NPC should defend members of its faction.voidsetDialog(int slot, int dialogId)Sets the dialog for the specified slot by its ID.voidsetDialog(int slot, IDialog dialog)Sets the dialog for the specified slot.voidsetDirectLOS(boolean directLOS)Sets whether the NPC requires direct line-of-sight to attack.voidsetDisablePitch(boolean disablePitch)Sets whether pitch variation is disabled for NPC sounds.voidsetDistanceToMelee(int distance)Sets the distance at which the NPC switches from ranged to melee.voidsetDoorInteract(int doorInteract)Sets the NPC's door interaction behavior.voidsetDrowningType(int type)Sets the drowning behavior of the NPC.voidsetExplosionResistance(float resistance)Sets the NPC's explosion resistance.voidsetFaction(int id)Sets the NPC's faction by its ID.voidsetFireRate(int rate)Sets the fire rate for ranged attacks.voidsetFireSound(String fireSound)Sets the sound directory for projectile firing.voidsetFly(int fly)Sets the NPC's flying ability.voidsetFlyGravity(double flyGravity)Sets the gravity effect on the NPC while flying.voidsetFlyHeightLimit(int flyHeightLimit)Sets the maximum flying height for the NPC.voidsetFlySpeed(double flySpeed)Sets the NPC's flying speed.voidsetGlowTexture(String texture)Sets the NPC's glow texture path.voidsetHeadScale(float x, float y, float z)Deprecated.voidsetHealthRegen(float regen)Sets the NPC's health regeneration per second when not in combat.voidsetHome(int x, int y, int z)Sets the home position using individual coordinates.voidsetHome(IPos pos)Sets the home position using an IPos instance.voidsetHomeX(int x)Sets the home position X coordinate.voidsetHomeY(int y)Sets the home position Y coordinate.voidsetHomeZ(int z)Sets the home position Z coordinate.voidsetHurtSound(String sound)Sets the NPC's hurt sound resource path.voidsetIdleSound(String sound)Sets the NPC's idle sound resource path.voidsetIgnoreCobweb(boolean ignore)Sets whether the NPC ignores cobwebs.voidsetImmuneToFire(boolean immuneToFire)Sets whether the NPC is immune to fire.voidsetJob(int job)Sets the NPC's job by its ID.voidsetKnockback(int knockback)Sets the knockback strength of the NPC.voidsetKnockbackResistance(double resistance)Sets the NPC's knockback resistance.voidsetLeapType(int leapType)Sets the NPC's leap attack type.voidsetLeftItem(IItemStack item)Sets the item held in the NPC's left hand.voidsetLegsScale(float x, float y, float z)Deprecated.voidsetLivingAnimation(boolean livingAnimation)Sets whether the NPC has a living animation.voidsetLootChance(int slot, double chance)Sets the drop chance for the loot item in the specified slot.voidsetLootItem(int slot, IItemStack item)Sets the loot item in the NPC's drop list for the given slot.voidsetLootMode(int lootMode)Sets the NPC's loot mode.voidsetMaxHealth(double health)Sets the NPC's maximum health.voidsetMaxLootXP(int lootXP)Sets the maximum XP dropped by the NPC.voidsetMaxProjectileDelay(int maxDelay)Sets the maximum delay (in ticks) between projectiles.voidsetMeleeRange(int range)Sets the melee range of the NPC.voidsetMeleeResistance(float resistance)Sets the NPC's melee resistance.voidsetMeleeSpeed(int speed)Sets the melee speed of the NPC.voidsetMeleeStrength(double strength)Sets the melee strength of the NPC.voidsetMinLootXP(int lootXP)Sets the minimum XP dropped by the NPC.voidsetMinPointsToSoulStone(int points)Sets the minimum faction points required to capture the NPC with a soul stone.voidsetMinProjectileDelay(int minDelay)Sets the minimum delay (in ticks) between projectiles.voidsetModelType(int modelType)Sets the NPC's model type.voidsetMovingPattern(int pattern)Sets the NPC's path movement pattern.voidsetMovingPause(boolean movingPause)Sets whether the NPC pauses at path points.voidsetMovingType(int movingType)Sets the moving type of the NPC.voidsetName(String name)Sets the NPC's name.voidsetNaturallyDespawns(boolean canDespawn)Sets whether the NPC should naturally despawn.voidsetNoFallDamage(boolean noFallDamage)Sets whether the NPC takes no fall damage.voidsetNpcInteracting(boolean npcInteracting)Sets whether the NPC interacts with other NPCs.voidsetOnFoundEnemy(int onAttack)Sets the NPC's behavior when encountering an enemy.voidsetOrderedLines(boolean ordered)Sets whether NPC dialog lines are played in order.voidsetOverlayTexture(String overlayTexture)Adds an overlay texture to the NPC.voidsetPotionImmune(boolean potionImmune)Sets whether the NPC is immune to potion effects.voidsetProjectileInvincibility(boolean invincible)Sets whether the NPC has projectile invincibility frames.voidsetProjectileItem(IItemStack item)Sets the projectile item for the NPC.voidsetProjectilesKeepTerrain(boolean b)Sets whether projectiles fired by the NPC should ignore terrain collisions.voidsetRangedBurst(int count)Sets the number of projectiles in a ranged burst attack.voidsetRangedRange(int rangedRange)Sets the range for ranged attacks.voidsetRangedSpeed(int speed)Sets the ranged attack speed of the NPC.voidsetRangedStrength(float strength)Sets the ranged attack strength of the NPC.voidsetReactsToFire(boolean reactsToFire)Sets whether the NPC reacts to fire.voidsetRefuseSoulStone(boolean refuse)Sets whether the NPC refuses to be captured by a soul stone.voidsetRespawnCycle(int cycle)Sets the NPC's respawn cycle.voidsetRespawnTime(int time)Sets the number of ticks before the NPC respawns.voidsetRetaliateType(int type)Sets the NPC's retaliation type.voidsetReturnToHome(boolean bo)Sets whether the NPC should return to its home position.voidsetRightItem(IItemStack item)Sets the item held in the NPC's right hand.voidsetRole(int role)Sets the NPC's role by its ID.voidsetRotation(float rotation)Sets the NPC's rotation (yaw).voidsetRotationType(int rotationType)Sets the NPC's rotation type.voidsetShelterFrom(int shelterFrom)Sets the condition under which the NPC seeks shelter.voidsetShotCount(int shotCount)Sets the number of shots fired.voidsetShowBossBar(int type)Sets the visibility type of the NPC's boss bar.voidsetShowName(int type)Sets the visibility type of the NPC's name.voidsetSize(int size)Sets the NPC's size (scale factor).voidsetSkinType(byte type)Sets the NPC's skin type.voidsetSkinUrl(String url)Sets the NPC's skin URL.voidsetSpeed(double speed)Sets the NPC's walking speed.voidsetStepSound(String sound)Sets the NPC's step/footstep sound resource path.voidsetStopAndInteract(boolean stopAndInteract)Sets whether the NPC stops moving to interact with players.voidsetSwingWarmup(int ticks)Sets the swing warmup time (in ticks) before melee damage is applied.voidsetTacticalChance(int chance)Sets the tactical behavior chance (1 in N).voidsetTacticalRadius(int tacticalRadius)Sets the tactical radius affecting NPC behavior.voidsetTacticalVariant(int variant)Sets the NPC's tactical variant.voidsetTacticalVariant(String variant)Sets the NPC's tactical variant by its name.voidsetTexture(String texture)Sets the NPC's texture.voidsetTitle(String title)Sets the NPC's title.voidsetUseRangeMelee(int useRangeMelee)Sets the NPC's use-range-melee mode.voidsetVisibleTo(IPlayer player, boolean visible)Sets whether the NPC is visible to a specific player.voidsetVisibleType(int type)Sets the visibility type of the NPC.voidsetWalkingRange(int range)Sets the NPC's walking range (wander radius).voidshootItem(IEntityLivingBase target, IItemStack item, int accuracy)Instructs the NPC to shoot an item at a target.booleanspawnedFromSoulStone()Returns whether the NPC was spawned using a soul stone.booleantypeOf(int type)Checks if the NPC is of the given type.voidupdateAI()Updates the NPC's AI tasks.voidupdateClient()Updates the client with the latest NPC state.-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getCollidingEntities, 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, 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, applyKnockback, applyKnockback, canBreatheUnderwater, clearPotionEffects, dismountEntity, forceKnockback, forceKnockback, getAbsorptionAmount, getAIMoveSpeed, getArrowCountInEntity, getAttackTarget, getAttackTargetTime, getFollowRange, getHealth, getHeldItem, getLastAttacker, getLastAttackerTime, getLookingAtBlock, getLookingAtBlock, getLookingAtEntities, getLookingAtEntities, getLookingAtEntities, getLookingAtPos, getLookingAtPos, getLookVector, getMaxHealth, getMaxHurtTime, getPotionEffect, getTotalArmorValue, hurt, hurt, hurt, isAttacking, isChild, isOnLadder, renderBrokenItemStack, setAbsorptionAmount, setAIMoveSpeed, setArrowCountInEntity, setAttackTarget, setFollowRange, setHealth, setHeldItem, setHurtTime, setLastAttacker, setMaxHurtTime, swingHand
-
-
-
-
Method Detail
-
getSize
int getSize()
Returns the current NPC's size (scale factor) within the range 1–30.- Returns:
- the NPC's size.
-
setSize
void setSize(int size)
Sets the NPC's size (scale factor).- Parameters:
size- the size of the NPC (range 1–30, default is 5).
-
getModelType
int getModelType()
Returns the NPC's model type.- Returns:
- the model type.
-
setModelType
void setModelType(int modelType)
Sets the NPC's model type.- Parameters:
modelType- the model type (0: Steve, 1: Steve64, 2: Alex).
-
getName
String getName()
Returns the NPC's name.- Returns:
- the NPC's name.
-
setRotation
void setRotation(float rotation)
Sets the NPC's rotation (yaw).- Specified by:
setRotationin interfaceIEntity<T extends net.minecraft.entity.EntityCreature>- Parameters:
rotation- the new rotation angle in degrees.
-
setRotationType
void setRotationType(int rotationType)
Sets the NPC's rotation type.- Parameters:
rotationType- the rotation type (implementation-specific).
-
getRotationType
int getRotationType()
Returns the NPC's rotation type.- Returns:
- the rotation type.
-
setMovingType
void setMovingType(int movingType)
Sets the moving type of the NPC.- Parameters:
movingType- the moving type (0: standing, 1: wandering, 2: moving path).
-
getMovingType
int getMovingType()
Returns the moving type of the NPC.- Returns:
- the moving type (0: standing, 1: wandering, 2: moving path).
-
setName
void setName(String name)
Sets the NPC's name.- Parameters:
name- the new name.
-
getTitle
String getTitle()
Returns the NPC's title.- Returns:
- the NPC's title.
-
setTitle
void setTitle(String title)
Sets the NPC's title.- Parameters:
title- the new title.
-
getTexture
String getTexture()
Returns the NPC's texture path.- Returns:
- the texture path.
-
setTexture
void setTexture(String texture)
Sets the NPC's texture.- Parameters:
texture- the new texture path.
-
getHome
IPos getHome()
Returns the NPC's home position.- Returns:
- the home position as an IPos.
-
getHomeX
int getHomeX()
Returns the home position X coordinate.- Returns:
- the home X coordinate.
-
setHomeX
void setHomeX(int x)
Sets the home position X coordinate.- Parameters:
x- the new home X coordinate.
-
getHomeY
int getHomeY()
Returns the home position Y coordinate.- Returns:
- the home Y coordinate.
-
setHomeY
void setHomeY(int y)
Sets the home position Y coordinate.- Parameters:
y- the new home Y coordinate.
-
getHomeZ
int getHomeZ()
Returns the home position Z coordinate.- Returns:
- the home Z coordinate.
-
setHomeZ
void setHomeZ(int z)
Sets the home position Z coordinate.- Parameters:
z- the new home Z coordinate.
-
setHome
void setHome(int x, int y, int z)Sets the home position using individual coordinates.- Parameters:
x- the home X coordinate.y- the home Y coordinate.z- the home Z coordinate.
-
setHome
void setHome(IPos pos)
Sets the home position using an IPos instance.- Parameters:
pos- the new home position.
-
setMaxHealth
void setMaxHealth(double health)
Sets the NPC's maximum health.- Specified by:
setMaxHealthin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
health- the new maximum health.
-
setReturnToHome
void setReturnToHome(boolean bo)
Sets whether the NPC should return to its home position.- Parameters:
bo- true to enable returning home, false otherwise.
-
getReturnToHome
boolean getReturnToHome()
Returns whether the NPC is set to return home.- Returns:
- true if the NPC returns home, false otherwise.
-
getFaction
IFaction getFaction()
Returns the faction associated with the NPC.- Returns:
- the NPC's faction.
-
setFaction
void setFaction(int id)
Sets the NPC's faction by its ID.- Parameters:
id- the faction ID.
-
setAttackFactions
void setAttackFactions(boolean attackOtherFactions)
Sets whether the NPC will attack members of other factions.- Parameters:
attackOtherFactions- true to attack, false otherwise.
-
getAttackFactions
boolean getAttackFactions()
Returns whether the NPC attacks other factions.- Returns:
- true if it attacks, false otherwise.
-
setDefendFaction
void setDefendFaction(boolean defendFaction)
Sets whether the NPC should defend members of its faction.- Parameters:
defendFaction- true to defend, false otherwise.
-
getDefendFaction
boolean getDefendFaction()
Returns whether the NPC defends its faction.- Returns:
- true if it defends, false otherwise.
-
getType
int getType()
Returns the entity type of the NPC.
-
typeOf
boolean typeOf(int type)
Checks if the NPC is of the given type.- Specified by:
typeOfin interfaceIEntity<T extends net.minecraft.entity.EntityCreature>- Specified by:
typeOfin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
type- the type to check.- Returns:
- true if the NPC matches the specified type; otherwise, defers to the parent.
-
shootItem
void shootItem(IEntityLivingBase target, IItemStack item, int accuracy)
Instructs the NPC to shoot an item at a target.- Parameters:
target- the target entity.item- the item to shoot.accuracy- the accuracy of the shot (0–100).
-
setProjectilesKeepTerrain
void setProjectilesKeepTerrain(boolean b)
Sets whether projectiles fired by the NPC should ignore terrain collisions.- Parameters:
b- true if projectiles keep terrain, false otherwise.
-
getProjectilesKeepTerrain
boolean getProjectilesKeepTerrain()
Returns whether projectiles fired by the NPC ignore terrain collisions.- Returns:
- true if they ignore terrain, false otherwise.
-
setProjectileInvincibility
void setProjectileInvincibility(boolean invincible)
Sets whether the NPC has projectile invincibility frames.- Parameters:
invincible- true to enable projectile invincibility, false to disable.
-
getProjectileInvincibility
boolean getProjectileInvincibility()
Returns whether the NPC has projectile invincibility frames.- Returns:
- true if projectile invincibility is enabled, false otherwise.
-
say
void say(String message)
Makes the NPC broadcast a message.- Parameters:
message- the message to say.
-
say
void say(IPlayer player, String message)
Makes the NPC send a message to a specific player.- Parameters:
player- the target player.message- the message to say.
-
getDialog
IDialog getDialog(int slot)
Retrieves the dialog from the specified slot.- Parameters:
slot- the dialog slot.- Returns:
- the dialog instance.
-
getDialogId
int getDialogId(int slot)
Returns the dialog ID in the specified slot.- Parameters:
slot- the dialog slot.- Returns:
- the dialog ID, or -1 if none exists.
-
setDialog
void setDialog(int slot, IDialog dialog)Sets the dialog for the specified slot.- Parameters:
slot- the dialog slot.dialog- the dialog instance.
-
setDialog
void setDialog(int slot, int dialogId)Sets the dialog for the specified slot by its ID.- Parameters:
slot- the dialog slot.dialogId- the dialog ID.
-
getInteractLines
ILines getInteractLines()
Returns the lines used for NPC interaction.- Returns:
- the interact lines.
-
getWorldLines
ILines getWorldLines()
Returns the lines displayed in the world.- Returns:
- the world lines.
-
getAttackLines
ILines getAttackLines()
Returns the lines spoken when the NPC attacks.- Returns:
- the attack lines.
-
getKilledLines
ILines getKilledLines()
Returns the lines spoken when the NPC is killed.- Returns:
- the killed lines.
-
getKillLines
ILines getKillLines()
Returns the lines spoken when the NPC kills another entity.- Returns:
- the kill lines.
-
getOrderedLines
boolean getOrderedLines()
Returns whether NPC dialog lines are played in order.- Returns:
- true if lines are ordered, false if random.
-
setOrderedLines
void setOrderedLines(boolean ordered)
Sets whether NPC dialog lines are played in order.- Parameters:
ordered- true for ordered, false for random.
-
getIdleSound
String getIdleSound()
Returns the NPC's idle sound resource path.- Returns:
- the idle sound path, or empty string if none.
-
setIdleSound
void setIdleSound(String sound)
Sets the NPC's idle sound resource path.- Parameters:
sound- the idle sound path.
-
getAngrySound
String getAngrySound()
Returns the NPC's angry/aggro sound resource path.- Returns:
- the angry sound path, or empty string if none.
-
setAngrySound
void setAngrySound(String sound)
Sets the NPC's angry/aggro sound resource path.- Parameters:
sound- the angry sound path.
-
getHurtSound
String getHurtSound()
Returns the NPC's hurt sound resource path.- Returns:
- the hurt sound path.
-
setHurtSound
void setHurtSound(String sound)
Sets the NPC's hurt sound resource path.- Parameters:
sound- the hurt sound path.
-
getDeathSound
String getDeathSound()
Returns the NPC's death sound resource path.- Returns:
- the death sound path.
-
setDeathSound
void setDeathSound(String sound)
Sets the NPC's death sound resource path.- Parameters:
sound- the death sound path.
-
getStepSound
String getStepSound()
Returns the NPC's step/footstep sound resource path.- Returns:
- the step sound path, or empty string if none.
-
setStepSound
void setStepSound(String sound)
Sets the NPC's step/footstep sound resource path.- Parameters:
sound- the step sound path.
-
getDisablePitch
boolean getDisablePitch()
Returns whether pitch variation is disabled for NPC sounds.- Returns:
- true if pitch is disabled (fixed pitch), false otherwise.
-
setDisablePitch
void setDisablePitch(boolean disablePitch)
Sets whether pitch variation is disabled for NPC sounds.- Parameters:
disablePitch- true to disable pitch variation, false to allow.
-
kill
void kill()
Kills the NPC without despawning it.
-
reset
void reset()
Resets the NPC to its initial state and triggers the initialization script.
-
getAnimationData
IAnimationData getAnimationData()
Returns the NPC's animation data.- Specified by:
getAnimationDatain interfaceIAnimatable- Returns:
- the animation data.
-
getRole
IRole getRole()
Returns the NPC's current role.- Returns:
- the role instance.
-
setRole
void setRole(int role)
Sets the NPC's role by its ID.- Parameters:
role- the role ID.
-
getJob
IJob getJob()
Returns the NPC's current job.- Returns:
- the job instance.
-
setJob
void setJob(int job)
Sets the NPC's job by its ID.- Parameters:
job- the job ID.
-
getRightItem
IItemStack getRightItem()
Returns the item held in the NPC's right hand.- Returns:
- the right-hand item.
-
setRightItem
void setRightItem(IItemStack item)
Sets the item held in the NPC's right hand.- Parameters:
item- the new item.
-
getLefttItem
@Deprecated IItemStack getLefttItem()
Deprecated.(Deprecated) Returns the item held in the NPC's left hand.- Returns:
- the left-hand item.
-
getLeftItem
IItemStack getLeftItem()
Returns the item held in the NPC's left hand.- Returns:
- the left-hand item.
-
setLeftItem
void setLeftItem(IItemStack item)
Sets the item held in the NPC's left hand.- Parameters:
item- the new item.
-
getProjectileItem
IItemStack getProjectileItem()
Returns the projectile item used by the NPC.- Returns:
- the projectile item.
-
setProjectileItem
void setProjectileItem(IItemStack item)
Sets the projectile item for the NPC.- Parameters:
item- the new projectile item.
-
canAimWhileShooting
@Deprecated boolean canAimWhileShooting()
Deprecated.Checks if the NPC can aim while shooting.- Returns:
- true if aiming while shooting is enabled, false otherwise.
-
aimWhileShooting
@Deprecated void aimWhileShooting(boolean aimWhileShooting)
Deprecated.Sets whether the NPC can aim while shooting.- Parameters:
aimWhileShooting- true to enable aiming, false to disable.
-
setAimType
void setAimType(byte aimWhileShooting)
Sets the Aim Type for an NPC- Parameters:
aimWhileShooting- 0: No, 1: Yes, 2: On Shot
-
getAimType
byte getAimType()
Gets the Aim Type for an NPC- Returns:
- 0: No, 1: Yes, 2: On Shot
-
setMinProjectileDelay
void setMinProjectileDelay(int minDelay)
Sets the minimum delay (in ticks) between projectiles.- Parameters:
minDelay- the minimum delay.
-
getMinProjectileDelay
int getMinProjectileDelay()
Returns the minimum projectile delay.- Returns:
- the minimum delay in ticks.
-
setMaxProjectileDelay
void setMaxProjectileDelay(int maxDelay)
Sets the maximum delay (in ticks) between projectiles.- Parameters:
maxDelay- the maximum delay.
-
getMaxProjectileDelay
int getMaxProjectileDelay()
Returns the maximum projectile delay.- Returns:
- the maximum delay in ticks.
-
setRangedRange
void setRangedRange(int rangedRange)
Sets the range for ranged attacks.- Parameters:
rangedRange- the ranged attack range.
-
getRangedRange
int getRangedRange()
Returns the range for ranged attacks.- Returns:
- the ranged attack range.
-
setFireRate
void setFireRate(int rate)
Sets the fire rate for ranged attacks.- Parameters:
rate- the fire rate in ticks.
-
getFireRate
int getFireRate()
Returns the fire rate for ranged attacks.- Returns:
- the fire rate.
-
setBurstCount
void setBurstCount(int burstCount)
Sets the number of shots in a burst.- Parameters:
burstCount- the burst count.
-
getBurstCount
int getBurstCount()
Returns the number of shots in a burst.- Returns:
- the burst count.
-
setShotCount
void setShotCount(int shotCount)
Sets the number of shots fired.- Parameters:
shotCount- the shot count.
-
getShotCount
int getShotCount()
Returns the number of shots fired.- Returns:
- the shot count.
-
setAccuracy
void setAccuracy(int accuracy)
Sets the shooting accuracy.- Parameters:
accuracy- the accuracy (0–100).
-
getAccuracy
int getAccuracy()
Returns the shooting accuracy.- Returns:
- the accuracy value.
-
getFireSound
String getFireSound()
Returns the sound directory played when a projectile is fired.- Returns:
- the fire sound directory.
-
setFireSound
void setFireSound(String fireSound)
Sets the sound directory for projectile firing.- Parameters:
fireSound- the new fire sound directory.
-
getArmor
IItemStack getArmor(int slot)
Returns the armor item in the specified slot.- Specified by:
getArmorin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
slot- the armor slot (0: head, 1: body, 2: legs, 3: boots).- Returns:
- the armor item.
-
setArmor
void setArmor(int slot, IItemStack item)Sets the armor item in the specified slot.- Specified by:
setArmorin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
slot- the armor slot (0: head, 1: body, 2: legs, 3: boots).item- the armor item.
-
getLootItem
IItemStack getLootItem(int slot)
Returns the loot item from the NPC's drop list for the given slot.- Parameters:
slot- the loot slot (0–8).- Returns:
- the loot item.
-
setLootItem
void setLootItem(int slot, IItemStack item)Sets the loot item in the NPC's drop list for the given slot.- Parameters:
slot- the loot slot (0–8).item- the new loot item.
-
getLootChance
double getLootChance(int slot)
Returns the chance for the loot item in the specified slot to drop.- Parameters:
slot- the loot slot (0–8).- Returns:
- the drop chance (default 100 if not set).
-
setLootChance
void setLootChance(int slot, double chance)Sets the drop chance for the loot item in the specified slot.- Parameters:
slot- the loot slot (0–8).chance- the new drop chance.
-
getLootMode
int getLootMode()
Returns the NPC's loot mode.- Returns:
- the loot mode (0: Normal, 1: Auto Pickup).
-
setLootMode
void setLootMode(int lootMode)
Sets the NPC's loot mode.- Parameters:
lootMode- the loot mode (0: Normal, 1: Auto Pickup).
-
setMinLootXP
void setMinLootXP(int lootXP)
Sets the minimum XP dropped by the NPC.- Parameters:
lootXP- the minimum loot XP.
-
setMaxLootXP
void setMaxLootXP(int lootXP)
Sets the maximum XP dropped by the NPC.- Parameters:
lootXP- the maximum loot XP.
-
getMinLootXP
int getMinLootXP()
Returns the minimum XP dropped by the NPC.- Returns:
- the minimum loot XP.
-
getMaxLootXP
int getMaxLootXP()
Returns the maximum XP dropped by the NPC.- Returns:
- the maximum loot XP.
-
getCanDrown
boolean getCanDrown()
Returns whether the NPC can drown.- Returns:
- true if the NPC can drown, false otherwise.
-
setCanDrown
void setCanDrown(boolean canDrown)
Sets whether the NPC can drown. Shorthand: sets drowning type to 1 (drowns in water) if true, 0 (never drowns) if false.- Parameters:
canDrown- true to allow drowning, false to prevent.
-
setDrowningType
void setDrowningType(int type)
Sets the drowning behavior of the NPC.- Parameters:
type- 0: Never drowns, 1: Drowns in water, 2: Drowns in air (without water).
-
canBreathe
boolean canBreathe()
Returns whether the NPC can breathe.- Returns:
- true if the NPC can breathe, false otherwise.
-
setAnimation
void setAnimation(int type)
Sets the NPC's animation type.- Parameters:
type- the animation type.
-
setTacticalVariant
void setTacticalVariant(int variant)
Sets the NPC's tactical variant.- Parameters:
variant- the tactical variant (0: Rush, 1: Dodge, 2: Surround, 3: Hit N Run, 4: Ambush, 5: Stalk, 6: None).
-
getTacticalVariant
int getTacticalVariant()
Returns the NPC's tactical variant.- Returns:
- the tactical variant as an integer.
-
setTacticalVariant
void setTacticalVariant(String variant)
Sets the NPC's tactical variant by its name.- Parameters:
variant- the name of the tactical variant.
-
getTacticalVariantName
String getTacticalVariantName()
Returns the name of the NPC's tactical variant.- Returns:
- the tactical variant name.
-
getCombatPolicyName
String getCombatPolicyName()
Returns the name of the NPC's combat policy.- Returns:
- the combat policy name.
-
setCombatPolicy
void setCombatPolicy(int policy)
Sets the NPC's combat policy.- Parameters:
policy- the combat policy (0: Flip, 1: Brute, 2: Stubborn, 4: Tactical).
-
getCombatPolicy
int getCombatPolicy()
Returns the NPC's combat policy.- Returns:
- the combat policy as an integer.
-
setCombatPolicy
void setCombatPolicy(String policy)
Sets the NPC's combat policy by name.- Parameters:
policy- the combat policy name.
-
setTacticalRadius
void setTacticalRadius(int tacticalRadius)
Sets the tactical radius affecting NPC behavior.- Parameters:
tacticalRadius- the tactical radius.
-
getTacticalRadius
int getTacticalRadius()
Returns the tactical radius affecting NPC behavior.- Returns:
- the tactical radius.
-
getTacticalChance
int getTacticalChance()
Returns the tactical behavior chance (1 in N).- Returns:
- the tactical chance.
-
setTacticalChance
void setTacticalChance(int chance)
Sets the tactical behavior chance (1 in N).- Parameters:
chance- the tactical chance.
-
getCanSwim
boolean getCanSwim()
Returns whether the NPC can swim.- Returns:
- true if the NPC can swim, false otherwise.
-
setCanSwim
void setCanSwim(boolean canSwim)
Sets whether the NPC can swim.- Parameters:
canSwim- true to enable swimming, false to disable.
-
getReactsToFire
boolean getReactsToFire()
Returns whether the NPC reacts to fire.- Returns:
- true if the NPC reacts to fire, false otherwise.
-
setReactsToFire
void setReactsToFire(boolean reactsToFire)
Sets whether the NPC reacts to fire.- Parameters:
reactsToFire- true to react, false otherwise.
-
getAvoidsWater
boolean getAvoidsWater()
Returns whether the NPC avoids water.- Returns:
- true if the NPC avoids water, false otherwise.
-
setAvoidsWater
void setAvoidsWater(boolean avoidsWater)
Sets whether the NPC avoids water.- Parameters:
avoidsWater- true to avoid water, false otherwise.
-
getAvoidsSun
boolean getAvoidsSun()
Returns whether the NPC avoids sunlight.- Returns:
- true if the NPC avoids the sun, false otherwise.
-
setAvoidsSun
void setAvoidsSun(boolean avoidsSun)
Sets whether the NPC avoids sunlight.- Parameters:
avoidsSun- true to avoid sunlight, false otherwise.
-
getDirectLOS
boolean getDirectLOS()
Returns whether the NPC requires direct line-of-sight to attack.- Returns:
- true if direct LOS is required, false otherwise.
-
setDirectLOS
void setDirectLOS(boolean directLOS)
Sets whether the NPC requires direct line-of-sight to attack.- Parameters:
directLOS- true to require LOS, false otherwise.
-
getLeapType
int getLeapType()
Returns the NPC's leap attack type.- Returns:
- the leap type.
-
setLeapType
void setLeapType(int leapType)
Sets the NPC's leap attack type.- Parameters:
leapType- the leap type.
-
getCanSprint
boolean getCanSprint()
Returns whether the NPC can sprint.- Returns:
- true if sprinting is enabled, false otherwise.
-
setCanSprint
void setCanSprint(boolean canSprint)
Sets whether the NPC can sprint.- Parameters:
canSprint- true to enable sprinting, false to disable.
-
getStopAndInteract
boolean getStopAndInteract()
Returns whether the NPC stops moving to interact with players.- Returns:
- true if the NPC stops to interact, false otherwise.
-
setStopAndInteract
void setStopAndInteract(boolean stopAndInteract)
Sets whether the NPC stops moving to interact with players.- Parameters:
stopAndInteract- true to stop and interact, false otherwise.
-
getDoorInteract
int getDoorInteract()
Returns the NPC's door interaction behavior.- Returns:
- the door interaction mode (0: Break, 1: Open, 2: Disabled).
-
setDoorInteract
void setDoorInteract(int doorInteract)
Sets the NPC's door interaction behavior.- Parameters:
doorInteract- the door interaction mode (0: Break, 1: Open, 2: Disabled).
-
getWalkingRange
int getWalkingRange()
Returns the NPC's walking range (wander radius).- Returns:
- the walking range.
-
setWalkingRange
void setWalkingRange(int range)
Sets the NPC's walking range (wander radius).- Parameters:
range- the walking range.
-
getNpcInteracting
boolean getNpcInteracting()
Returns whether the NPC interacts with other NPCs.- Returns:
- true if NPC interaction is enabled, false otherwise.
-
setNpcInteracting
void setNpcInteracting(boolean npcInteracting)
Sets whether the NPC interacts with other NPCs.- Parameters:
npcInteracting- true to enable, false to disable.
-
getMovingPause
boolean getMovingPause()
Returns whether the NPC pauses at path points.- Returns:
- true if the NPC pauses at path points, false otherwise.
-
setMovingPause
void setMovingPause(boolean movingPause)
Sets whether the NPC pauses at path points.- Parameters:
movingPause- true to pause, false otherwise.
-
getMovingPattern
int getMovingPattern()
Returns the NPC's path movement pattern.- Returns:
- the moving pattern (0: Looping, 1: Backtracking).
-
setMovingPattern
void setMovingPattern(int pattern)
Sets the NPC's path movement pattern.- Parameters:
pattern- the moving pattern (0: Looping, 1: Backtracking).
-
getCanFireIndirect
int getCanFireIndirect()
Returns whether the NPC fires indirect (arcing) projectiles.- Returns:
- the indirect fire mode.
-
setCanFireIndirect
void setCanFireIndirect(int canFireIndirect)
Sets whether the NPC fires indirect (arcing) projectiles.- Parameters:
canFireIndirect- the indirect fire mode.
-
getUseRangeMelee
int getUseRangeMelee()
Returns the NPC's use-range-melee mode.- Returns:
- the use-range-melee mode.
-
setUseRangeMelee
void setUseRangeMelee(int useRangeMelee)
Sets the NPC's use-range-melee mode.- Parameters:
useRangeMelee- the use-range-melee mode.
-
getDistanceToMelee
int getDistanceToMelee()
Returns the distance at which the NPC switches from ranged to melee.- Returns:
- the distance to melee.
-
setDistanceToMelee
void setDistanceToMelee(int distance)
Sets the distance at which the NPC switches from ranged to melee.- Parameters:
distance- the distance to melee.
-
getBodyOffsetX
float getBodyOffsetX()
Returns the NPC's body X offset.- Returns:
- the body X offset.
-
setBodyOffsetX
void setBodyOffsetX(float offsetX)
Sets the NPC's body X offset.- Parameters:
offsetX- the body X offset.
-
getBodyOffsetY
float getBodyOffsetY()
Returns the NPC's body Y offset.- Returns:
- the body Y offset.
-
setBodyOffsetY
void setBodyOffsetY(float offsetY)
Sets the NPC's body Y offset.- Parameters:
offsetY- the body Y offset.
-
getBodyOffsetZ
float getBodyOffsetZ()
Returns the NPC's body Z offset.- Returns:
- the body Z offset.
-
setBodyOffsetZ
void setBodyOffsetZ(float offsetZ)
Sets the NPC's body Z offset.- Parameters:
offsetZ- the body Z offset.
-
setIgnoreCobweb
void setIgnoreCobweb(boolean ignore)
Sets whether the NPC ignores cobwebs.- Parameters:
ignore- true to ignore cobwebs, false otherwise.
-
getIgnoreCobweb
boolean getIgnoreCobweb()
Returns whether the NPC ignores cobwebs.- Returns:
- true if cobwebs are ignored, false otherwise.
-
setOnFoundEnemy
void setOnFoundEnemy(int onAttack)
Sets the NPC's behavior when encountering an enemy.- Parameters:
onAttack- 0: Retaliate, 1: Panic, 2: Retreat, 3: Nothing.
-
onFoundEnemy
int onFoundEnemy()
Returns the NPC's behavior when encountering an enemy.- Returns:
- an integer representing the behavior (0: Retaliate, 1: Panic, 2: Retreat, 3: Nothing).
-
setShelterFrom
void setShelterFrom(int shelterFrom)
Sets the condition under which the NPC seeks shelter.- Parameters:
shelterFrom- 0: Darkness, 1: Sunlight, 2: Disabled.
-
getShelterFrom
int getShelterFrom()
Returns the condition under which the NPC seeks shelter.- Returns:
- an integer representing the shelter condition (0: Darkness, 1: Sunlight, 2: Disabled).
-
hasLivingAnimation
boolean hasLivingAnimation()
Returns whether the NPC has a living animation.- Returns:
- true if living animation is enabled, false otherwise.
-
setLivingAnimation
void setLivingAnimation(boolean livingAnimation)
Sets whether the NPC has a living animation.- Parameters:
livingAnimation- true to enable living animation, false to disable.
-
setVisibleType
void setVisibleType(int type)
Sets the visibility type of the NPC.- Parameters:
type- the visibility type (0: visible, 1: invisible, 2: semi-visible).
-
getVisibleType
int getVisibleType()
Returns the visibility type of the NPC.- Returns:
- the visibility type.
-
setVisibleTo
void setVisibleTo(IPlayer player, boolean visible)
Sets whether the NPC is visible to a specific player.- Parameters:
player- the player.visible- true if the NPC should be visible, false if invisible.
-
isVisibleTo
boolean isVisibleTo(IPlayer player)
Checks if the NPC is visible to a specific player.- Parameters:
player- the player.- Returns:
- true if the NPC is visible, false otherwise.
-
setShowName
void setShowName(int type)
Sets the visibility type of the NPC's name.- Parameters:
type- the visibility type (0: visible, 1: invisible, 2: when attacking).
-
getShowName
int getShowName()
Returns the visibility type of the NPC's name.- Returns:
- the name visibility type.
-
getShowBossBar
int getShowBossBar()
Returns the visibility type of the NPC's boss bar.- Returns:
- the boss bar visibility (0: invisible, 1: visible, 2: when attacking).
-
setShowBossBar
void setShowBossBar(int type)
Sets the visibility type of the NPC's boss bar.- Parameters:
type- the boss bar visibility (0: invisible, 1: visible, 2: when attacking).
-
getMeleeStrength
double getMeleeStrength()
Returns the melee strength of the NPC.- Specified by:
getMeleeStrengthin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Returns:
- the melee strength.
-
setMeleeStrength
void setMeleeStrength(double strength)
Sets the melee strength of the NPC.- Specified by:
setMeleeStrengthin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
strength- the new melee strength.
-
getMeleeSpeed
int getMeleeSpeed()
Returns the melee speed of the NPC.- Returns:
- the melee speed.
-
setMeleeSpeed
void setMeleeSpeed(int speed)
Sets the melee speed of the NPC.- Parameters:
speed- the new melee speed.
-
getMeleeRange
int getMeleeRange()
Returns the melee range of the NPC.- Returns:
- the melee range.
-
setMeleeRange
void setMeleeRange(int range)
Sets the melee range of the NPC.- Parameters:
range- the new melee range.
-
getSwingWarmup
int getSwingWarmup()
Returns the swing warmup time (in ticks) before melee damage is applied.- Returns:
- the swing warmup time.
-
setSwingWarmup
void setSwingWarmup(int ticks)
Sets the swing warmup time (in ticks) before melee damage is applied.- Parameters:
ticks- the warmup time.
-
getKnockback
int getKnockback()
Returns the knockback strength of the NPC.- Returns:
- the knockback strength.
-
setKnockback
void setKnockback(int knockback)
Sets the knockback strength of the NPC.- Parameters:
knockback- the new knockback strength.
-
getAggroRange
int getAggroRange()
Returns the aggro range of the NPC.- Returns:
- the aggro range.
-
setAggroRange
void setAggroRange(int aggroRange)
Sets the aggro range of the NPC.- Parameters:
aggroRange- the new aggro range.
-
getRangedStrength
float getRangedStrength()
Returns the ranged attack strength of the NPC.- Returns:
- the ranged strength.
-
setRangedStrength
void setRangedStrength(float strength)
Sets the ranged attack strength of the NPC.- Parameters:
strength- the new ranged strength.
-
getRangedSpeed
int getRangedSpeed()
Returns the ranged attack speed of the NPC.- Returns:
- the ranged speed.
-
setRangedSpeed
void setRangedSpeed(int speed)
Sets the ranged attack speed of the NPC.- Parameters:
speed- the new ranged speed.
-
getRangedBurst
int getRangedBurst()
Returns the number of projectiles in a ranged burst attack.- Returns:
- the burst count.
-
setRangedBurst
void setRangedBurst(int count)
Sets the number of projectiles in a ranged burst attack.- Parameters:
count- the new burst count.
-
getRespawnTime
int getRespawnTime()
Returns the number of ticks before the NPC respawns.- Returns:
- the respawn time.
-
setRespawnTime
void setRespawnTime(int time)
Sets the number of ticks before the NPC respawns.- Parameters:
time- the respawn time.
-
getRespawnCycle
int getRespawnCycle()
Returns the NPC's respawn cycle.- Returns:
- the respawn cycle (0: Always, 1: Day, 2: Night, 3: No respawn).
-
setRespawnCycle
void setRespawnCycle(int cycle)
Sets the NPC's respawn cycle.- Parameters:
cycle- the respawn cycle (0: Always, 1: Day, 2: Night, 3: No respawn).
-
getHideKilledBody
boolean getHideKilledBody()
Returns whether the NPC's body is hidden upon death.- Returns:
- true if the body is hidden, false otherwise.
-
hideKilledBody
void hideKilledBody(boolean hide)
Sets whether the NPC's body should be hidden upon death.- Parameters:
hide- true to hide the body, false otherwise.
-
naturallyDespawns
boolean naturallyDespawns()
Returns whether the NPC naturally despawns.- Returns:
- true if it naturally despawns, false otherwise.
-
setNaturallyDespawns
void setNaturallyDespawns(boolean canDespawn)
Sets whether the NPC should naturally despawn.- Parameters:
canDespawn- true to allow natural despawning, false otherwise.
-
spawnedFromSoulStone
boolean spawnedFromSoulStone()
Returns whether the NPC was spawned using a soul stone.- Returns:
- true if spawned from a soul stone, false otherwise.
-
getSoulStonePlayerName
String getSoulStonePlayerName()
Returns the name of the player who spawned this NPC using a soul stone.- Returns:
- the player's name, or null if not spawned by soul stone.
-
isSoulStoneInit
boolean isSoulStoneInit()
Returns whether the NPC has been initialized after a soul stone spawn.- Returns:
- true if initialized, false otherwise.
-
getRefuseSoulStone
boolean getRefuseSoulStone()
Returns whether the NPC refuses to be captured by a soul stone.- Returns:
- true if it refuses, false otherwise.
-
setRefuseSoulStone
void setRefuseSoulStone(boolean refuse)
Sets whether the NPC refuses to be captured by a soul stone.- Parameters:
refuse- true to refuse, false to allow.
-
getMinPointsToSoulStone
int getMinPointsToSoulStone()
Returns the minimum faction points required to capture the NPC with a soul stone.- Returns:
- the minimum points (default -1 means use the faction's friendly points).
-
setMinPointsToSoulStone
void setMinPointsToSoulStone(int points)
Sets the minimum faction points required to capture the NPC with a soul stone.- Parameters:
points- the minimum faction points.
-
giveItem
void giveItem(IPlayer player, IItemStack item)
Gives an item to the specified player.- Parameters:
player- the recipient.item- the item to give.
-
executeCommand
void executeCommand(String command)
Executes a command as the NPC.Note: On servers the enable-command-block option must be set to true.
- Parameters:
command- the command to execute.
-
getModelData
IModelData getModelData()
Returns the model data associated with the NPC.- Returns:
- the model data, or null if not available.
-
getHitboxData
IHitboxData getHitboxData()
Returns the hitbox data associated with the NPC.- Returns:
- the hitbox data.
-
getTintData
ITintData getTintData()
Returns the tint data associated with the NPC.- Returns:
- the tint data.
-
setHeadScale
@Deprecated void setHeadScale(float x, float y, float z)
Deprecated.(Deprecated) Sets the head scale of the NPC.- Parameters:
x- scale factor along the X-axis.y- scale factor along the Y-axis.z- scale factor along the Z-axis.
-
setBodyScale
@Deprecated void setBodyScale(float x, float y, float z)
Deprecated.(Deprecated) Sets the body scale of the NPC.- Parameters:
x- scale factor along the X-axis.y- scale factor along the Y-axis.z- scale factor along the Z-axis.
-
setArmsScale
@Deprecated void setArmsScale(float x, float y, float z)
Deprecated.(Deprecated) Sets the arms scale of the NPC.- Parameters:
x- scale factor along the X-axis.y- scale factor along the Y-axis.z- scale factor along the Z-axis.
-
setLegsScale
@Deprecated void setLegsScale(float x, float y, float z)
Deprecated.(Deprecated) Sets the legs scale of the NPC.- Parameters:
x- scale factor along the X-axis.y- scale factor along the Y-axis.z- scale factor along the Z-axis.
-
setExplosionResistance
void setExplosionResistance(float resistance)
Sets the NPC's explosion resistance.- Parameters:
resistance- the resistance (0–2, default is 1).
-
getExplosionResistance
float getExplosionResistance()
Returns the NPC's explosion resistance.- Returns:
- the explosion resistance.
-
setMeleeResistance
void setMeleeResistance(float resistance)
Sets the NPC's melee resistance.- Parameters:
resistance- the resistance (0–2, default is 1).
-
getMeleeResistance
float getMeleeResistance()
Returns the NPC's melee resistance.- Returns:
- the melee resistance.
-
setArrowResistance
void setArrowResistance(float resistance)
Sets the NPC's arrow resistance.- Parameters:
resistance- the resistance (0–2, default is 1).
-
getArrowResistance
float getArrowResistance()
Returns the NPC's arrow resistance.- Returns:
- the arrow resistance.
-
setKnockbackResistance
void setKnockbackResistance(double resistance)
Sets the NPC's knockback resistance.- Specified by:
setKnockbackResistancein interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
resistance- the resistance (0–2, default is 1).
-
getKnockbackResistance
double getKnockbackResistance()
Returns the NPC's knockback resistance.- Specified by:
getKnockbackResistancein interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Returns:
- the knockback resistance.
-
getDamageDisabled
boolean getDamageDisabled()
Returns whether all damage to this NPC is disabled.- Returns:
- true if damage is disabled, false otherwise.
-
setDamageDisabled
void setDamageDisabled(boolean disabled)
Sets whether all damage to this NPC is disabled.- Parameters:
disabled- true to disable all damage, false otherwise.
-
getNoFallDamage
boolean getNoFallDamage()
Returns whether the NPC takes no fall damage.- Returns:
- true if fall damage is disabled, false otherwise.
-
setNoFallDamage
void setNoFallDamage(boolean noFallDamage)
Sets whether the NPC takes no fall damage.- Parameters:
noFallDamage- true to disable fall damage, false to enable.
-
getImmuneToFire
boolean getImmuneToFire()
Returns whether the NPC is immune to fire.- Returns:
- true if immune to fire, false otherwise.
-
setImmuneToFire
void setImmuneToFire(boolean immuneToFire)
Sets whether the NPC is immune to fire.- Parameters:
immuneToFire- true to make immune, false otherwise.
-
getPotionImmune
boolean getPotionImmune()
Returns whether the NPC is immune to potion effects.- Returns:
- true if potion immune, false otherwise.
-
setPotionImmune
void setPotionImmune(boolean potionImmune)
Sets whether the NPC is immune to potion effects.- Parameters:
potionImmune- true to make immune, false otherwise.
-
getBurnInSun
boolean getBurnInSun()
Returns whether the NPC burns in sunlight.- Returns:
- true if the NPC burns in the sun, false otherwise.
-
setBurnInSun
void setBurnInSun(boolean burnInSun)
Sets whether the NPC burns in sunlight.- Parameters:
burnInSun- true to burn in sunlight, false otherwise.
-
getAttackInvisible
boolean getAttackInvisible()
Returns whether the NPC can attack invisible targets.- Returns:
- true if the NPC attacks invisible entities, false otherwise.
-
setAttackInvisible
void setAttackInvisible(boolean attackInvisible)
Sets whether the NPC can attack invisible targets.- Parameters:
attackInvisible- true to allow attacking invisible entities, false otherwise.
-
getCreatureType
int getCreatureType()
Returns the NPC's creature type.- Returns:
- the creature type ordinal (0: Undefined, 1: Undead, 2: Arthropod).
-
setCreatureType
void setCreatureType(int type)
Sets the NPC's creature type.- Parameters:
type- the creature type ordinal (0: Undefined, 1: Undead, 2: Arthropod).
-
setRetaliateType
void setRetaliateType(int type)
Sets the NPC's retaliation type.- Parameters:
type- the retaliation type (0: normal, 1: panic, 2: retreat, 3: nothing).
-
getCombatRegen
float getCombatRegen()
Returns the NPC's combat health regeneration per second.- Returns:
- the combat regen rate.
-
setCombatRegen
void setCombatRegen(float regen)
Sets the NPC's combat health regeneration per second.- Parameters:
regen- the combat regen rate.
-
getHealthRegen
float getHealthRegen()
Returns the NPC's health regeneration per second when not in combat.- Returns:
- the health regen rate.
-
setHealthRegen
void setHealthRegen(float regen)
Sets the NPC's health regeneration per second when not in combat.- Parameters:
regen- the health regen rate.
-
getAge
long getAge()
Returns the age of the NPC in ticks.
-
getTimers
ITimers getTimers()
Returns the timers associated with the NPC.- Returns:
- the timers.
-
setFly
void setFly(int fly)
Sets the NPC's flying ability.- Parameters:
fly- 1 to enable flying, 0 to disable.
-
canFly
boolean canFly()
Returns whether the NPC can fly.- Returns:
- true if flying is enabled, false otherwise.
-
setFlySpeed
void setFlySpeed(double flySpeed)
Sets the NPC's flying speed.- Parameters:
flySpeed- the fly speed.
-
getFlySpeed
double getFlySpeed(double unused)
Returns the NPC's flying speed.- Parameters:
unused- unused parameter.- Returns:
- the fly speed.
-
setFlyGravity
void setFlyGravity(double flyGravity)
Sets the gravity effect on the NPC while flying.- Parameters:
flyGravity- the fly gravity (0.0–1.0).
-
getFlyGravity
double getFlyGravity(double unused)
Returns the gravity effect on the NPC while flying.- Parameters:
unused- unused parameter.- Returns:
- the fly gravity.
-
setFlyHeightLimit
void setFlyHeightLimit(int flyHeightLimit)
Sets the maximum flying height for the NPC.- Parameters:
flyHeightLimit- the height limit.
-
getFlyHeightLimit
int getFlyHeightLimit(int unused)
Returns the maximum flying height for the NPC.- Parameters:
unused- unused parameter.- Returns:
- the fly height limit.
-
limitFlyHeight
void limitFlyHeight(boolean limit)
Enables or disables flying height limitation.- Parameters:
limit- true to enable limitation, false to disable.
-
isFlyHeightLimited
boolean isFlyHeightLimited(boolean unused)
Checks if flying height is limited.- Parameters:
unused- unused parameter.- Returns:
- true if limited, false otherwise.
-
setSpeed
void setSpeed(double speed)
Sets the NPC's walking speed.- Specified by:
setSpeedin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Parameters:
speed- the walking speed.
-
getSpeed
double getSpeed()
Returns the NPC's walking speed.- Specified by:
getSpeedin interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityCreature>- Returns:
- the walking speed.
-
setSkinType
void setSkinType(byte type)
Sets the NPC's skin type.- Parameters:
type- the skin type.
-
getSkinType
byte getSkinType()
Returns the NPC's skin type.- Returns:
- the skin type.
-
setSkinUrl
void setSkinUrl(String url)
Sets the NPC's skin URL.- Parameters:
url- the skin URL.
-
getSkinUrl
String getSkinUrl()
Returns the NPC's skin URL.- Returns:
- the skin URL.
-
setCloakTexture
void setCloakTexture(String cloakTexture)
Sets the NPC's cloak texture.- Parameters:
cloakTexture- the cloak texture.
-
getCloakTexture
String getCloakTexture()
Returns the NPC's cloak texture.- Returns:
- the cloak texture.
-
setOverlayTexture
void setOverlayTexture(String overlayTexture)
Adds an overlay texture to the NPC.- Parameters:
overlayTexture- the overlay texture.
-
getOverlayTexture
String getOverlayTexture()
Returns the first overlay texture of the NPC.- Returns:
- the overlay texture, or an empty string if none.
-
getGlowTexture
String getGlowTexture()
Returns the NPC's glow texture path.- Returns:
- the glow texture path, or empty string if none.
-
setGlowTexture
void setGlowTexture(String texture)
Sets the NPC's glow texture path.- Parameters:
texture- the glow texture path.
-
getOverlays
IOverlayHandler getOverlays()
Returns the NPC's overlay handler.- Returns:
- the overlay handler.
-
setCollisionType
void setCollisionType(int type)
Sets the NPC's collision type.- Parameters:
type- the collision type.
-
getCollisionType
int getCollisionType()
Returns the NPC's collision type.- Returns:
- the collision type.
-
updateClient
void updateClient()
Updates the client with the latest NPC state.
-
updateAI
void updateAI()
Updates the NPC's AI tasks.
-
getActionManager
IActionManager getActionManager()
Returns the action manager used for scheduling NPC actions.- Returns:
- the action manager.
-
getMagicData
IMagicData getMagicData()
Returns the Magic Data of an NPC- Returns:
- Magic data
-
getAbilityData
IDataAbilities getAbilityData()
Returns the Ability Data of an NPC. Allows access to the NPC's abilities system including force-starting abilities and executing preset abilities.- Returns:
- Ability data
-
getActiveEnergyProjectiles
IEnergyProjectile[] getActiveEnergyProjectiles()
Returns all active energy projectiles fired by this NPC.- Returns:
- Array of active energy projectiles, empty array if none
-
-