Package noppes.npcs.api.entity
Interface IPlayer<T extends net.minecraft.server.level.ServerPlayer>
- All Superinterfaces:
IEntity<T>,IEntityLiving<T>
public interface IPlayer<T extends net.minecraft.server.level.ServerPlayer>
extends IEntityLiving<T>
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDialog(int id) voidaddFactionPoints(int faction, int points) booleancanQuestBeAccepted(int id) voidWANRING, REMOVES ALL PLAYER DATA (data only from CustomNPCs, does not clear inventory etc)voidcloseGui()intfactionStatus(int factionId) voidfinishQuest(int id) Add the quest from finished quest listIQuest[]intintgetFactionPoints(int faction) IQuest[]intintExpert users onlygetSkin()booleanbooleangiveItem(IItemStack item) booleanhasActiveQuest(int id) booleanhasAdvancement(String achievement) booleanhasFinishedQuest(int id) booleanhasPermission(String permission) booleanhasReadDialog(int id) voidvoidhideOverlay(int id) intDeprecated.intinventoryItemCount(IItemStack item) Deprecated.voidvoidvoidvoidvoidremoveAllItems(IItemStack item) voidremoveDialog(int id) booleanremoveItem(String id, int amount) booleanremoveItem(IItemStack item, int amount) voidremoveQuest(int id) Removes the quest from active and finished quest listvoidvoidsendMail(IPlayerMail mail) voidsendNotification(String title, String msg, int type) voidsetExpLevel(int level) voidsetGamemode(int mode) voidsetHunger(int level) voidsetSpawnpoint(int x, int y, int z) Same as the /spawnpoint commandvoidsetSpawnPoint(IBlock block) voidshowCustomGui(ICustomGui gui) Open a ICustomGui to this player.voidshowDialog(int id, String name) voidshowOverlay(IOverlay overlay) voidvoidstartQuest(int id) voidstopQuest(int id) Removes the quest from active quest listvoidFires trigger event for player scriptsvoidSyncs inventory changes to the client side.Methods inherited from interface noppes.npcs.api.entity.IEntity
addRider, addTag, clearRiders, damage, 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, typeOfMethods inherited from interface noppes.npcs.api.entity.IEntityLiving
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
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
- Parameters:
name- Name of the person talking in the dialog
-
showSoundSelectionGUI
void showSoundSelectionGUI() -
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
-
getGamemode
int getGamemode() -
setGamemode
void setGamemode(int mode) -
inventoryItemCount
Deprecated.Use getInventory().count instead -
inventoryItemCount
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
- Parameters:
id- The items nameamount- 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
- Parameters:
id- The items nameamount- 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() -
hasAdvancement
- Parameters:
achievement- The achievement id. For a complete list see- Returns:
- Returns whether or not the player has this achievement
-
getExpLevel
int getExpLevel() -
setExpLevel
void setExpLevel(int level) -
hasPermission
-
getPixelmonData
Object getPixelmonData() -
getTimers
ITimers getTimers() -
closeGui
void closeGui() -
getMCEntity
T getMCEntity()Description copied from interface:IEntityExpert users only- Specified by:
getMCEntityin interfaceIEntity<T extends net.minecraft.server.level.ServerPlayer>- Specified by:
getMCEntityin interfaceIEntityLiving<T extends net.minecraft.server.level.ServerPlayer>- Returns:
- Returns minecrafts entity
-
getSpawnPoint
IBlock getSpawnPoint() -
setSpawnPoint
-
getHunger
int getHunger() -
setHunger
void setHunger(int level) -
kick
- Parameters:
message- The message the player gets when kicked
-
sendNotification
- 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
- Parameters:
sound- Sounds resource namevolume- default 1pitch- default 1
-
playMusic
- Parameters:
sound- Sounds resource namebackground- Whether to play the music in the background or like a jukebox in a specific locationloops- Whether the music loops
-
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
-
trigger
Fires trigger event for player scripts- Parameters:
id- , Id for the eventarguments- , arguments you can give with it
-
showOverlay
-
hideOverlay
void hideOverlay(int id) -
hideAllOverlays
void hideAllOverlays() -
getSkin
IPlayerSkin getSkin()
-