Package noppes.npcs.api.entity
Interface IPlayer<T extends net.minecraft.entity.player.EntityPlayerMP>
- All Superinterfaces:
IEntity<T>
,IEntityLivingBase<T>
public interface IPlayer<T extends net.minecraft.entity.player.EntityPlayerMP> extends IEntityLivingBase<T>
-
Method Summary
Modifier and Type Method Description void
addDialog(int id)
void
addFactionPoints(int faction, int points)
boolean
canQuestBeAccepted(int id)
void
clearData()
WANRING, REMOVES ALL PLAYER DATA (data only from CustomNPCs, does not clear inventory etc)void
closeGui()
int
factionStatus(int factionId)
void
finishQuest(int id)
Add the quest from finished quest listIQuest[]
getActiveQuests()
ICustomGui
getCustomGui()
java.lang.String
getDisplayName()
int
getExpLevel()
int
getFactionPoints(int faction)
IQuest[]
getFinishedQuests()
int
getGamemode()
int
getHunger()
IContainer
getInventory()
IItemStack
getInventoryHeldItem()
T
getMCEntity()
Expert users onlyIContainer
getOpenContainer()
java.lang.Object
getPixelmonData()
IBlock
getSpawnPoint()
ITimers
getTimers()
boolean
giveItem(java.lang.String id, int damage, int amount)
boolean
giveItem(IItemStack item)
boolean
hasAchievement(java.lang.String achievement)
boolean
hasActiveQuest(int id)
boolean
hasFinishedQuest(int id)
boolean
hasPermission(java.lang.String permission)
boolean
hasReadDialog(int id)
int
inventoryItemCount(java.lang.String id, int damage)
Deprecated.int
inventoryItemCount(IItemStack item)
Deprecated.void
kick(java.lang.String message)
void
message(java.lang.String message)
void
playSound(java.lang.String sound, float volume, float pitch)
void
removeAllItems(IItemStack item)
void
removeDialog(int id)
boolean
removeItem(java.lang.String id, int damage, int amount)
boolean
removeItem(IItemStack item, int amount)
void
removeQuest(int id)
Removes the quest from active and finished quest listvoid
resetSpawnpoint()
void
sendMail(IPlayerMail mail)
void
sendNotification(java.lang.String title, java.lang.String msg, int type)
void
setExpLevel(int level)
void
setGamemode(int mode)
void
setHunger(int level)
void
setSpawnpoint(int x, int y, int z)
Same as the /spawnpoint commandvoid
setSpawnPoint(IBlock block)
IContainer
showChestGui(int rows)
Deprecated.Its better to use showCustomGuivoid
showCustomGui(ICustomGui gui)
Open a ICustomGui to this player.void
showDialog(int id, java.lang.String name)
void
startQuest(int id)
void
stopQuest(int id)
Removes the quest from active quest listvoid
updatePlayerInventory()
Syncs inventory changes to the client side.Methods inherited from interface noppes.npcs.api.entity.IEntity
addRider, addTag, clearRiders, damage, despawn, dropItem, extinguish, generateNewUUID, getAge, getAllRiders, getBlockX, getBlockY, getBlockZ, getEntityName, getEntityNbt, getEyeHeight, getHeight, getMotionX, getMotionY, getMotionZ, getMount, getName, getNbt, getPitch, getPos, getRiders, getRotation, getStoreddata, getTags, getTempdata, getType, getTypeName, getUUID, getWidth, getWorld, getX, getY, getZ, hasCustomName, hasTag, inFire, inLava, inWater, isAlive, isBurning, isSneaking, isSprinting, kill, knockback, playAnimation, rayTraceBlock, rayTraceEntities, removeTag, setBurning, setEntityNbt, setMotionX, setMotionY, setMotionZ, setMount, setName, setPitch, setPos, setPosition, setRotation, setX, setY, setZ, spawn, storeAsClone, typeOf
Methods inherited from interface noppes.npcs.api.entity.IEntityLivingBase
addMark, addPotionEffect, canSeeEntity, clearPotionEffects, getArmor, getAttackTarget, getHealth, getLastAttacked, getLastAttackedTime, getMainhandItem, getMarks, getMaxHealth, getMoveForward, getMoveStrafing, getMoveVertical, getOffhandItem, getPotionEffect, isAttacking, isChild, removeMark, setArmor, setAttackTarget, setHealth, setMainhandItem, setMaxHealth, setMoveForward, setMoveStrafing, setMoveVertical, setOffhandItem, swingMainhand, swingOffhand
-
Method Details
-
getDisplayName
java.lang.String getDisplayName() -
hasFinishedQuest
boolean hasFinishedQuest(int id) -
hasActiveQuest
boolean hasActiveQuest(int id) -
startQuest
void startQuest(int id) -
factionStatus
int factionStatus(int factionId)- Returns:
- Returns -1:Unfriendly, 0:Neutral, 1:Friendly
-
finishQuest
void finishQuest(int id)Add the quest from finished quest list- Parameters:
id
- The Quest ID
-
stopQuest
void stopQuest(int id)Removes the quest from active quest list- Parameters:
id
- The Quest ID
-
removeQuest
void removeQuest(int id)Removes the quest from active and finished quest list- Parameters:
id
- The Quest ID
-
hasReadDialog
boolean hasReadDialog(int id) -
showDialog
void showDialog(int id, java.lang.String name)- Parameters:
name
- Name of the person talking in the dialog
-
removeDialog
void removeDialog(int id)- Parameters:
id
- Removes the given id from the read dialogs list
-
addDialog
void addDialog(int id)- Parameters:
id
- Adds the given id to the read dialogs
-
addFactionPoints
void addFactionPoints(int faction, int points)- Parameters:
faction
- The faction idpoints
- The points to increase. Use negative values to decrease
-
getFactionPoints
int getFactionPoints(int faction)- Parameters:
faction
- The faction id- Returns:
- points
-
message
void message(java.lang.String message) -
getGamemode
int getGamemode() -
setGamemode
void setGamemode(int mode) -
inventoryItemCount
Deprecated.Use getInventory().count instead -
inventoryItemCount
int inventoryItemCount(java.lang.String id, int damage)Deprecated.Use getInventory().count instead -
getInventory
IContainer getInventory()- Returns:
- Returns a IItemStack array size 36
-
getInventoryHeldItem
IItemStack getInventoryHeldItem()- Returns:
- Returns the itemstack the player is currently holding in a container gui
-
removeItem
- Parameters:
item
- The Item type to be removedamount
- How many will be removed- Returns:
- Returns true if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given
-
removeItem
boolean removeItem(java.lang.String id, int damage, int amount)- Parameters:
id
- The items namedamage
- The damage value (give -1 for any damage value)amount
- How many will be removed- Returns:
- Returns true if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given or item doesnt exist
-
removeAllItems
-
giveItem
- Parameters:
item
- Item to be added- Returns:
- Returns whether or not it gave the item succesfully
-
giveItem
boolean giveItem(java.lang.String id, int damage, int amount)- Parameters:
id
- The items namedamage
- The damage valueamount
- The amount of the item to be added- Returns:
- Returns whether or not it gave the item succesfully
-
setSpawnpoint
void setSpawnpoint(int x, int y, int z)Same as the /spawnpoint command- Parameters:
x
- The x positiony
- The y positionz
- The z position
-
resetSpawnpoint
void resetSpawnpoint() -
hasAchievement
boolean hasAchievement(java.lang.String achievement)- Parameters:
achievement
- The achievement id. For a complete list seegetExpLevel
int getExpLevel()
-
setExpLevel
void setExpLevel(int level) -
hasPermission
boolean hasPermission(java.lang.String permission) -
getPixelmonData
java.lang.Object getPixelmonData() -
getTimers
ITimers getTimers() -
closeGui
void closeGui() -
getMCEntity
T getMCEntity()Description copied from interface:IEntity
Expert users only- Specified by:
getMCEntity
in interfaceIEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
- Specified by:
getMCEntity
in interfaceIEntityLivingBase<T extends net.minecraft.entity.player.EntityPlayerMP>
- Returns:
- Returns minecrafts entity
-
getSpawnPoint
IBlock getSpawnPoint() -
setSpawnPoint
-
getHunger
int getHunger() -
setHunger
void setHunger(int level) -
kick
void kick(java.lang.String message)- Parameters:
message
- The message the player gets when kicked
-
sendNotification
void sendNotification(java.lang.String title, java.lang.String msg, int type)- Parameters:
title
- Title of the notificationmsg
- Message of the notificationtype
- (0-3) notification background type
-
sendMail
-
clearData
void clearData()WANRING, REMOVES ALL PLAYER DATA (data only from CustomNPCs, does not clear inventory etc) -
getActiveQuests
IQuest[] getActiveQuests() -
getFinishedQuests
IQuest[] getFinishedQuests() -
updatePlayerInventory
void updatePlayerInventory()Syncs inventory changes to the client side. Also checks Item Quests for completion -
playSound
void playSound(java.lang.String sound, float volume, float pitch)- Parameters:
sound
- Sounds resource namevolume
- default 1pitch
- default 1
-
showChestGui
Deprecated.Its better to use showCustomGui- Parameters:
rows
- (1-6)- Returns:
- Returns the IContainer of the chest gui
-
getOpenContainer
IContainer getOpenContainer()- Returns:
- Returns the container of the player if he has a container gui open. Returns the inventory container if none is open
-
canQuestBeAccepted
boolean canQuestBeAccepted(int id) -
showCustomGui
Open a ICustomGui to this player.- Parameters:
gui
- Custom GUI to be displayed to the player.
-
getCustomGui
ICustomGui getCustomGui()- Returns:
- Returns the currently opened custom gui
-