Interface ICustomNpc<T extends net.minecraft.entity.EntityCreature>

    • Method Detail

      • getSize

        int getSize()
        Returns:
        Returns the current npcs size 1-30
      • setSize

        void setSize​(int size)
        Parameters:
        size - The size of the npc (1-30) default is 5
      • getModelType

        int getModelType()
        Returns:
        Returns the current npcs modelType of the NPC
      • setModelType

        void setModelType​(int modelType)
        Parameters:
        modelType - The modelType of the NPC. 0: Steve, 1: Steve64, 2: Alex
      • getName

        java.lang.String getName()
        Returns:
        The npcs name
      • setRotation

        void setRotation​(float rotation)
        Specified by:
        setRotation in interface IEntity<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        rotation - The rotation to be set (0-360)
      • setRotationType

        void setRotationType​(int rotationType)
      • getRotationType

        int getRotationType()
      • setMovingType

        void setMovingType​(int movingType)
        Parameters:
        movingType - The moving type of the npc. 0 = standing, 1 = wandering, 2 = moving path
      • getMovingType

        int getMovingType()
        Returns:
        The moving type of the npc. 0 = standing, 1 = wandering, 2 = moving path
      • setName

        void setName​(java.lang.String name)
        Parameters:
        name - The name of the npc
      • getTitle

        java.lang.String getTitle()
        Returns:
        The npcs title
        Since:
        1.7.10
      • setTitle

        void setTitle​(java.lang.String title)
        Parameters:
        title - The title of the npc
        Since:
        1.7.10
      • getTexture

        java.lang.String getTexture()
        Returns:
        The npcs texture
      • setTexture

        void setTexture​(java.lang.String texture)
        Parameters:
        texture - The texture of the npc
      • getHome

        IPos getHome()
      • getHomeX

        int getHomeX()
        Returns:
        Home position x
      • setHomeX

        void setHomeX​(int x)
        Parameters:
        x - The home x position
      • getHomeY

        int getHomeY()
        Returns:
        Home position x
      • setHomeY

        void setHomeY​(int y)
        Parameters:
        y - The home y position
      • getHomeZ

        int getHomeZ()
        Returns:
        Home position x
      • setHomeZ

        void setHomeZ​(int z)
        Parameters:
        z - The home x position
      • setHome

        void setHome​(int x,
                     int y,
                     int z)
        Parameters:
        x - The home x position
        y - The home y position
        z - The home z position
      • setHome

        void setHome​(IPos pos)
      • setMaxHealth

        void setMaxHealth​(double health)
        Specified by:
        setMaxHealth in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        health - New max health
      • setReturnToHome

        void setReturnToHome​(boolean bo)
        Parameters:
        bo - Whether or not the npc will try to return to his home position
      • getReturnToHome

        boolean getReturnToHome()
        Returns:
        Whether or not the npc returns home
      • getFaction

        IFaction getFaction()
        Returns:
        The faction of the npc
      • setFaction

        void setFaction​(int id)
        Parameters:
        id - The id of the new faction
      • setAttackFactions

        void setAttackFactions​(boolean attackOtherFactions)
        Parameters:
        attackOtherFactions - True if you want the NPC to attack other factions, false otherwise.
      • getAttackFactions

        boolean getAttackFactions()
        Returns:
        Returns true if the NPC attacks other factions, false otherwise.
      • setDefendFaction

        void setDefendFaction​(boolean defendFaction)
        Parameters:
        defendFaction - True if the NPC should defend faction members, false otherwise.
      • getDefendFaction

        boolean getDefendFaction()
        Returns:
        Returns true if the NPC should defend faction members, false otherwise.
      • getType

        int getType()
        Specified by:
        getType in interface IEntity<T extends net.minecraft.entity.EntityCreature>
        Specified by:
        getType in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Returns:
        Returns the EntityType of this entity
        See Also:
        EntityType
      • typeOf

        boolean typeOf​(int type)
        Specified by:
        typeOf in interface IEntity<T extends net.minecraft.entity.EntityCreature>
        Specified by:
        typeOf in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Returns:
        Returns whether the entity is type of the given @EntityType
      • shootItem

        void shootItem​(IEntityLivingBase target,
                       IItemStack item,
                       int accuracy)
        Parameters:
        target - The targeted npc
        item - The item you want to shoot
        accuracy - Accuracy of the shot (0-100)
      • setProjectilesKeepTerrain

        void setProjectilesKeepTerrain​(boolean b)
      • getProjectilesKeepTerrain

        boolean getProjectilesKeepTerrain()
      • say

        void say​(java.lang.String message)
        Parameters:
        message - The message the npc will say
      • say

        void say​(IPlayer player,
                 java.lang.String message)
        Parameters:
        message - The message the npc will say
      • getDialog

        IDialog getDialog​(int slot)
      • getDialogId

        int getDialogId​(int slot)
      • setDialog

        void setDialog​(int slot,
                       IDialog dialog)
      • setDialog

        void setDialog​(int slot,
                       int dialogId)
      • getInteractLines

        ILines getInteractLines()
      • getWorldLines

        ILines getWorldLines()
      • getAttackLines

        ILines getAttackLines()
      • getKilledLines

        ILines getKilledLines()
      • getKillLines

        ILines getKillLines()
      • kill

        void kill()
        Kill the npc, doesnt't despawn it
      • reset

        void reset()
        Basically completely resets the npc. This will also call the Init script
      • getRole

        IRole getRole()
        Returns:
        Returns the npcs current role
      • setRole

        void setRole​(int role)
      • getJob

        IJob getJob()
        Returns:
        Returns the npcs current job
      • setJob

        void setJob​(int job)
      • getRightItem

        IItemStack getRightItem()
        Returns:
        The item held in the right hand
      • setRightItem

        void setRightItem​(IItemStack item)
        Parameters:
        item - Item to be held in the right hand
      • getLefttItem

        IItemStack getLefttItem()
        Was an old type
        Returns:
        The item held in the left hand
      • getLeftItem

        IItemStack getLeftItem()
        Returns:
        The item held in the left hand
      • setLeftItem

        void setLeftItem​(IItemStack item)
        Parameters:
        item - Item to be held in the left hand
      • getProjectileItem

        IItemStack getProjectileItem()
        Returns:
        Returns the projectile the npc uses
      • setProjectileItem

        void setProjectileItem​(IItemStack item)
        Parameters:
        item - Item to be used as projectile
      • canAimWhileShooting

        boolean canAimWhileShooting()
        Returns:
        Returns true if the NPC can aim while shooting.
      • aimWhileShooting

        void aimWhileShooting​(boolean aimWhileShooting)
        Parameters:
        aimWhileShooting - Set to true if you want the NPC to aim while shooting, false otherwise.
      • setMinProjectileDelay

        void setMinProjectileDelay​(int minDelay)
      • getMinProjectileDelay

        int getMinProjectileDelay()
      • setMaxProjectileDelay

        void setMaxProjectileDelay​(int maxDelay)
      • getMaxProjectileDelay

        int getMaxProjectileDelay()
      • setRangedRange

        void setRangedRange​(int rangedRange)
      • getRangedRange

        int getRangedRange()
      • setFireRate

        void setFireRate​(int rate)
      • getFireRate

        int getFireRate()
      • setBurstCount

        void setBurstCount​(int burstCount)
      • getBurstCount

        int getBurstCount()
      • setShotCount

        void setShotCount​(int shotCount)
      • getShotCount

        int getShotCount()
      • setAccuracy

        void setAccuracy​(int accuracy)
      • getAccuracy

        int getAccuracy()
      • getFireSound

        java.lang.String getFireSound()
        Returns:
        The directory of the sound that plays when a projectile is shot
      • setFireSound

        void setFireSound​(java.lang.String fireSound)
        Parameters:
        fireSound - The new directory of the sound that plays when a projectile is shot
      • getArmor

        IItemStack getArmor​(int slot)
        Description copied from interface: IEntityLivingBase
        Note not all Living Entities support this
        Specified by:
        getArmor in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        slot - The armor slot to return. 0:head, 1:body, 2:legs, 3:boots
        Returns:
        Returns the worn armor in slot
      • setArmor

        void setArmor​(int slot,
                      IItemStack item)
        Description copied from interface: IEntityLivingBase
        Note not all Living Entities support this
        Specified by:
        setArmor in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        slot - The armor slot to set. 0:head, 1:body, 2:legs, 3:boots
        item - Item to be set as armor
      • getLootItem

        IItemStack getLootItem​(int slot)
        Parameters:
        slot - The slot from the NPC's drop list to return (0-8)
        Returns:
        The item in the NPC's drop list slot
      • setLootItem

        void setLootItem​(int slot,
                         IItemStack item)
        Parameters:
        slot - The slot from the NPC's drop list to change
        item - The item the drop list slot will be changed to
      • getLootChance

        double getLootChance​(int slot)
        Parameters:
        slot - The slot from the NPC's drop list to return (0-8)
        Returns:
        The chance of dropping the item in this slot. Returns 100 if the slot is not found.
      • setLootChance

        void setLootChance​(int slot,
                           double chance)
        Parameters:
        slot - The slot from the NPC's drop list to change
        chance - The new chance of dropping the item in this slot
      • getLootMode

        int getLootMode()
        Returns:
        The NPC's loot mode. 0 = Normal, 1 = Auto Pickup
      • setLootMode

        void setLootMode​(int lootMode)
        Parameters:
        lootMode - The NPC's loot mode. 0 = Normal, 1 = Auto Pickup
      • setMinLootXP

        void setMinLootXP​(int lootXP)
        Parameters:
        lootXP - The new minimum XP gained from killing the NPC. If greater than the max XP, it will be set to it.
      • setMaxLootXP

        void setMaxLootXP​(int lootXP)
        Parameters:
        lootXP - The new maximum XP gained from killing the NPC. If less than the min XP, it will be set to it.
      • getMinLootXP

        int getMinLootXP()
        Returns:
        The minimum XP gained from killing the NPC.
      • getMaxLootXP

        int getMaxLootXP()
        Returns:
        The maximum XP gained from killing the NPC.
      • getCanDrown

        boolean getCanDrown()
      • setDrowningType

        void setDrowningType​(int type)
        Parameters:
        type - 0 - Never drowns, 1 - Drowns in water, 2 - Drowns in air (without water)
      • canBreathe

        boolean canBreathe()
      • setAnimation

        void setAnimation​(int type)
        Parameters:
        type - The AnimationType
      • setTacticalVariant

        void setTacticalVariant​(int variant)
        Parameters:
        variant - Changes the tactical variant of the NPC. 0 - Rush 1 - Dodge 2 - Surround 3 - Hit N Run 4 - Ambush 5 - Stalk 6 - None
      • getTacticalVariant

        int getTacticalVariant()
        Returns:
        Returns the tactical variant of the NPC. 0 - Rush 1 - Dodge 2 - Surround 3 - Hit N Run 4 - Ambush 5 - Stalk 6 - None
      • setTacticalVariant

        void setTacticalVariant​(java.lang.String variant)
        Parameters:
        variant - Sets the NPC's tactical variant by name.
      • getTacticalVariantName

        java.lang.String getTacticalVariantName()
        Returns:
        Returns the name of the NPc's tactical variant.
      • getCombatPolicyName

        java.lang.String getCombatPolicyName()
        Returns:
        Returns the name of the NPC's combat policy.
      • setCombatPolicy

        void setCombatPolicy​(int policy)
        Parameters:
        policy - Changes the combat policy of the NPC. 0 - Flip 1 - Brute 2 - Stubborn 4 - Tactical
      • getCombatPolicy

        int getCombatPolicy()
        Returns:
        Returns the ombat policy of the NPC. 0 - Flip 1 - Brute 2 - Stubborn 3 - Tactical
      • setCombatPolicy

        void setCombatPolicy​(java.lang.String policy)
        Parameters:
        policy - Sets the NPC's tactical variant by name.
      • setTacticalRadius

        void setTacticalRadius​(int tacticalRadius)
        Parameters:
        tacticalRadius - Sets the radius in which the tactical variant is affected, if any. Effective for all tactical variants except Rush and None.
      • getTacticalRadius

        int getTacticalRadius()
        Returns:
        Gets the radius in which the tactical variant is affected, if any. Effective for all tactical variants except Rush and None.
      • setIgnoreCobweb

        void setIgnoreCobweb​(boolean ignore)
        Parameters:
        ignore - True if the NPC goes through cobwebs
      • getIgnoreCobweb

        boolean getIgnoreCobweb()
        Returns:
        True if the NPC goes through cobwebs
      • setOnFoundEnemy

        void setOnFoundEnemy​(int onAttack)
      • onFoundEnemy

        int onFoundEnemy()
        Returns:
        Returns an integer representing what the NPC does when it finds an enemy. 0 - Retaliate 1 - Panic 2 - Retreat 3 - Nothing
      • setShelterFrom

        void setShelterFrom​(int shelterFrom)
        Parameters:
        shelterFrom - An integer representing what conditions the NPC seeks shelter under. 0 - Darkenss 1 - Sunlight 2 - Disabled
      • getShelterFrom

        int getShelterFrom()
        Returns:
        Returns an integer representing what conditions the NPC seeks shelter under. 0 - Darkenss 1 - Sunlight 2 - Disabled
      • hasLivingAnimation

        boolean hasLivingAnimation()
        Returns:
        Whether the NPC has a living animation
      • setLivingAnimation

        void setLivingAnimation​(boolean livingAnimation)
        Parameters:
        livingAnimation - True if you want the NPC to have a living animation, false otherwise
      • setVisibleType

        void setVisibleType​(int type)
        Parameters:
        type - The visibility type of the npc, 0:visible, 1:invisible, 2:semi-visible
      • getVisibleType

        int getVisibleType()
        Returns:
        The visibility type of the npc, 0:visible, 1:invisible, 2:semi-visible
      • setVisibleTo

        void setVisibleTo​(IPlayer player,
                          boolean visible)
        Parameters:
        player - The player this NPC becomes visible/invisible to
        visible - True if you want the NPC to be invisible to the player, false otherwise
      • isVisibleTo

        boolean isVisibleTo​(IPlayer player)
        Parameters:
        player - The player this NPC is visible/invisible to
        Returns:
        False if the NPC has been toggled to be invisible to this player, true otherwise. If setVisibleTo(player,visible) was not called to make this NPC invisible to the player at any point in the NPC's life, this function will return true regardless of the value of isVisible().
      • setShowName

        void setShowName​(int type)
        Parameters:
        type - The visibility type of the name, 0:visible, 1:invisible, 2:when-attacking
      • getShowName

        int getShowName()
        Returns:
        Returns the visibility type of the name, 0:visible, 1:invisible, 2:when-attacking
      • getShowBossBar

        int getShowBossBar()
        Returns:
        Returns the visiblity of the boss bar, 0:invisible, 1:visible, 2:when-attacking
      • setShowBossBar

        void setShowBossBar​(int type)
        Parameters:
        type - The visibility type of the boss bar, 0:invisible, 1:visible, 2:when-attacking
      • getMeleeStrength

        double getMeleeStrength()
        Specified by:
        getMeleeStrength in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Returns:
        The melee strength
      • setMeleeStrength

        void setMeleeStrength​(double strength)
        Specified by:
        setMeleeStrength in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        strength - The melee strength
      • getMeleeSpeed

        int getMeleeSpeed()
        Returns:
        The melee speed
      • setMeleeSpeed

        void setMeleeSpeed​(int speed)
        Parameters:
        speed - The melee speed
      • getMeleeRange

        int getMeleeRange()
        Returns:
        The melee range
      • setMeleeRange

        void setMeleeRange​(int range)
        Parameters:
        range - The melee range
      • getSwingWarmup

        int getSwingWarmup()
        Returns:
        The swing warmup time in ticks
      • setSwingWarmup

        void setSwingWarmup​(int ticks)
        Parameters:
        ticks - The amount of time before damage to swing arm
      • getKnockback

        int getKnockback()
        Returns:
        The knockback strength
      • setKnockback

        void setKnockback​(int knockback)
        Parameters:
        knockback - The melee range
      • getAggroRange

        int getAggroRange()
        Returns:
        The aggro range
      • setAggroRange

        void setAggroRange​(int aggroRange)
        Parameters:
        aggroRange - The new aggro range
      • getRangedStrength

        float getRangedStrength()
        Returns:
        The ranged strength
      • setRangedStrength

        void setRangedStrength​(float strength)
        Parameters:
        strength - The ranged strength
      • getRangedSpeed

        int getRangedSpeed()
        Returns:
        The ranged speed
      • setRangedSpeed

        void setRangedSpeed​(int speed)
        Parameters:
        speed - The ranged speed
      • getRangedBurst

        int getRangedBurst()
        Returns:
        The ranged burst count
      • setRangedBurst

        void setRangedBurst​(int count)
        Parameters:
        count - The ranged burst count
      • getRespawnTime

        int getRespawnTime()
        Returns:
        The amount of ticks before this entity respawns
      • setRespawnTime

        void setRespawnTime​(int time)
        Parameters:
        time - The new amount of ticks before this entity respawns
      • getRespawnCycle

        int getRespawnCycle()
        Returns:
        Respawn: 0 - Yes (Always), 1 - Day, 2 - Night, 3 - No (Dies permanently)
      • setRespawnCycle

        void setRespawnCycle​(int cycle)
        Parameters:
        cycle - Sets when the NPC respawns. Respawn: 0 - Yes (Always), 1 - Day, 2 - Night, 3 - No (Dies permanently)
      • getHideKilledBody

        boolean getHideKilledBody()
        Returns:
        Whether the NPC is hidden when it dies
      • hideKilledBody

        void hideKilledBody​(boolean hide)
        Parameters:
        hide - True if the NPC is hidden when it dies. False otherwise.
      • naturallyDespawns

        boolean naturallyDespawns()
        Returns:
        Returns true if the NPC naturally despawns.
      • setNaturallyDespawns

        void setNaturallyDespawns​(boolean canDespawn)
        Parameters:
        canDespawn - True if the NPC should naturally despawn. False otherwise.
      • spawnedFromSoulStone

        boolean spawnedFromSoulStone()
        Returns:
        true if this npc was spawned by a player using soulstone
      • getSoulStonePlayerName

        java.lang.String getSoulStonePlayerName()
        Returns:
        the name of the player who spawned this npc using soulstone. null if not spawned by soulstone
      • isSoulStoneInit

        boolean isSoulStoneInit()
        Returns:
        true if npc was spawned by soul stone. becomes false after the init function is called.
      • getRefuseSoulStone

        boolean getRefuseSoulStone()
        Returns:
        does this npc refuse to be taken by soul stone
      • setRefuseSoulStone

        void setRefuseSoulStone​(boolean refuse)
        Parameters:
        refuse - set if this npc refuses to be taken by soul stone
      • getMinPointsToSoulStone

        int getMinPointsToSoulStone()
        requires SoulStoneFriendlyNPCs in config to be true -1 by default if -1, the minimum points are the faction's friendly points
        Returns:
        the minimum faction points needed to soulstone this npc
      • setMinPointsToSoulStone

        void setMinPointsToSoulStone​(int points)
        requires SoulStoneFriendlyNPCs in config to be true -1 by default if -1, the minimum points are the faction's friendly points
        Parameters:
        points - the minimum faction points needed to soulstone this npc
      • giveItem

        void giveItem​(IPlayer player,
                      IItemStack item)
        Parameters:
        player - The player to give the item to
        item - The item given to the player
      • executeCommand

        void executeCommand​(java.lang.String command)
        On servers the enable-command-block option in the server.properties needs to be set to true
        Parameters:
        command - The command to be executed
      • setHeadScale

        @Deprecated
        void setHeadScale​(float x,
                          float y,
                          float z)
        Deprecated.
      • setBodyScale

        @Deprecated
        void setBodyScale​(float x,
                          float y,
                          float z)
        Deprecated.
      • setArmsScale

        @Deprecated
        void setArmsScale​(float x,
                          float y,
                          float z)
        Deprecated.
      • setLegsScale

        @Deprecated
        void setLegsScale​(float x,
                          float y,
                          float z)
        Deprecated.
      • setExplosionResistance

        void setExplosionResistance​(float resistance)
        Parameters:
        resistance - Explosion resistance (0-2) default is 1
        Since:
        1.7.10c
      • getExplosionResistance

        float getExplosionResistance()
        Returns:
        Returns Explosion Resistance
        Since:
        1.7.10c
      • setMeleeResistance

        void setMeleeResistance​(float resistance)
        Parameters:
        resistance - Melee resistance (0-2) default is 1
      • getMeleeResistance

        float getMeleeResistance()
        Returns:
        Returns Melee Resistance
      • setArrowResistance

        void setArrowResistance​(float resistance)
        Parameters:
        resistance - Arrow resistance (0-2) default is 1
      • getArrowResistance

        float getArrowResistance()
        Returns:
        Returns Arrow Resistance
      • setKnockbackResistance

        void setKnockbackResistance​(double resistance)
        Specified by:
        setKnockbackResistance in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Parameters:
        resistance - Knockback resistance (0-2) default is 1
      • getKnockbackResistance

        double getKnockbackResistance()
        Specified by:
        getKnockbackResistance in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
        Returns:
        Returns Knockback Resistance
      • setRetaliateType

        void setRetaliateType​(int type)
        Parameters:
        type - Retaliation type. 0:normal, 1:panic, 2:retreat, 3:nothing
      • getCombatRegen

        float getCombatRegen()
        Returns:
        Returns the combat health regen per second
      • setCombatRegen

        void setCombatRegen​(float regen)
        Parameters:
        regen - The combat health regen per second
      • getHealthRegen

        float getHealthRegen()
        Returns:
        Returns the health regen per second when not in combat
      • setHealthRegen

        void setHealthRegen​(float regen)
        Parameters:
        regen - The health regen per second when not in combat
      • getAge

        long getAge()
        Specified by:
        getAge in interface IEntity<T extends net.minecraft.entity.EntityCreature>
        Returns:
        The age of this entity in ticks
      • setFly

        void setFly​(int fly)
      • canFly

        boolean canFly()
      • setFlySpeed

        void setFlySpeed​(double flySpeed)
      • getFlySpeed

        double getFlySpeed​(double flySpeed)
      • setFlyGravity

        void setFlyGravity​(double flyGravity)
      • getFlyGravity

        double getFlyGravity​(double flyGravity)
      • setFlyHeightLimit

        void setFlyHeightLimit​(int flyHeightLimit)
      • getFlyHeightLimit

        int getFlyHeightLimit​(int flyHeightLimit)
      • limitFlyHeight

        void limitFlyHeight​(boolean limit)
      • isFlyHeightLimited

        boolean isFlyHeightLimited​(boolean limit)
      • setSpeed

        void setSpeed​(double speed)
        Specified by:
        setSpeed in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
      • getSpeed

        double getSpeed()
        Specified by:
        getSpeed in interface IEntityLivingBase<T extends net.minecraft.entity.EntityCreature>
      • setSkinType

        void setSkinType​(byte type)
      • getSkinType

        byte getSkinType()
      • setSkinUrl

        void setSkinUrl​(java.lang.String url)
      • getSkinUrl

        java.lang.String getSkinUrl()
      • setCloakTexture

        void setCloakTexture​(java.lang.String cloakTexture)
      • getCloakTexture

        java.lang.String getCloakTexture()
      • setOverlayTexture

        void setOverlayTexture​(java.lang.String overlayTexture)
      • getOverlayTexture

        java.lang.String getOverlayTexture()
      • setCollisionType

        void setCollisionType​(int type)
      • getCollisionType

        int getCollisionType()
      • updateClient

        void updateClient()
      • updateAI

        void updateAI()