com.mineblown.challengescript.scripting
Class ScriptNPC

java.lang.Object
  extended by com.mineblown.challengescript.scripting.ScriptNPC

public class ScriptNPC
extends java.lang.Object


Constructor Summary
ScriptNPC(int inID, com.mineblown.challengescript.npcs.HumanNPC inNPC, com.mineblown.challengescript.challenge.Challenge inChallenge)
           
ScriptNPC(java.lang.String inName, org.bukkit.Location inLoc, com.mineblown.challengescript.challenge.Challenge inChallenge)
           
 
Method Summary
 void attack(java.lang.String inPlayer)
          Attacks the player with the given name
 void despawn()
          Despawns the NPC
 ScriptPlayerArmor getArmor()
          Gets the armor of the NPC
 com.mineblown.challengescript.challenge.Challenge getChallenge()
           
 java.lang.String getEnterSightCallback()
          Gets the name of the method to execute when the player enters the sight range of the npc
 com.mineblown.challengescript.npcs.HumanNPC getHandle()
           
 int getHealth()
          Gets the current health of the NPC
 int getID()
          Gets the internal ID of the NPC
 java.lang.String getName()
          Gets the name of the NPC
 int getSightRange()
          Gets the sight range of the NPC
 boolean hasTarget()
          Checks if the NPC is currently attacking any target
 void move(double inX, double inY, double inZ)
          Moves NPC to given coordinates
 void move(ScriptLocation inLocation)
          Moves the NPC to given location
 void onEnterSight(java.lang.String inMethodCallback)
          Sets the method callback when a player enters the sight range of the NPC
 void playEffect(java.lang.String inEffect)
          Plays an entity effect such as getting hurt.
 void setArmor(ScriptPlayerArmor inArmor)
          Sets the armor of the NPC
 void setHealth(int inHealth)
          Sets the new health of the NPC
 void setItemInHand(java.lang.String inItem)
          Sets the item in the hand of the NPC
 void setName(java.lang.String inName)
          Sets a new name of the NPC
 void setSightRange(int inRange)
          Sets the sight range of the NPC
 void stopAttack()
          Stops the NPC from attacking.
 void stopMoving()
          Stops the current NPC movement.
 void teleport(int inX, int inY, int inZ)
          Teleports the NPC to given location
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptNPC

public ScriptNPC(java.lang.String inName,
                 org.bukkit.Location inLoc,
                 com.mineblown.challengescript.challenge.Challenge inChallenge)

ScriptNPC

public ScriptNPC(int inID,
                 com.mineblown.challengescript.npcs.HumanNPC inNPC,
                 com.mineblown.challengescript.challenge.Challenge inChallenge)
Method Detail

move

public void move(double inX,
                 double inY,
                 double inZ)
Moves NPC to given coordinates

Parameters:
inX - X coordinate
inY - Y coordinate
inZ - Z coordinate

move

public void move(ScriptLocation inLocation)
Moves the NPC to given location

Parameters:
inLocation - Location to move to

teleport

public void teleport(int inX,
                     int inY,
                     int inZ)
Teleports the NPC to given location

Parameters:
inX - X coordinate
inY - Y coordinate
inZ - Z coordinate

onEnterSight

public void onEnterSight(java.lang.String inMethodCallback)
Sets the method callback when a player enters the sight range of the NPC

Parameters:
inMethodCallback - Method name to execute

getEnterSightCallback

public java.lang.String getEnterSightCallback()
Gets the name of the method to execute when the player enters the sight range of the npc

Returns:
containing the name

setName

public void setName(java.lang.String inName)
Sets a new name of the NPC

Parameters:
inName - New name

attack

public void attack(java.lang.String inPlayer)
Attacks the player with the given name

Parameters:
inPlayer - Name of the player to attack

stopAttack

public void stopAttack()
Stops the NPC from attacking. Only required if the NPC is currently attacking something, otherwise it would do nothing.


stopMoving

public void stopMoving()
Stops the current NPC movement.


setItemInHand

public void setItemInHand(java.lang.String inItem)
Sets the item in the hand of the NPC

Parameters:
inItem - Material name of the item

getArmor

public ScriptPlayerArmor getArmor()
Gets the armor of the NPC

Returns:
Armor parts

setArmor

public void setArmor(ScriptPlayerArmor inArmor)
Sets the armor of the NPC

Parameters:
inArmor - New armor of NPC

hasTarget

public boolean hasTarget()
Checks if the NPC is currently attacking any target

Returns:
True if the NPC is currently attacking, false if not.

getID

public int getID()
Gets the internal ID of the NPC

Returns:
representing the id

getName

public java.lang.String getName()
Gets the name of the NPC

Returns:
Name

despawn

public void despawn()
Despawns the NPC


setSightRange

public void setSightRange(int inRange)
Sets the sight range of the NPC

Parameters:
inRange - New range

getSightRange

public int getSightRange()
Gets the sight range of the NPC

Returns:
representing the range of the sight

getHandle

public com.mineblown.challengescript.npcs.HumanNPC getHandle()

getChallenge

public com.mineblown.challengescript.challenge.Challenge getChallenge()

setHealth

public void setHealth(int inHealth)
Sets the new health of the NPC

Parameters:
inHealth - new Health

getHealth

public int getHealth()
Gets the current health of the NPC

Returns:
current health

playEffect

public void playEffect(java.lang.String inEffect)
Plays an entity effect such as getting hurt.

Parameters:
inEffect - The name of the effect to play.