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 TypeMethodDescriptionvoid
addDialog
(int id) void
addFactionPoints
(int faction, int points) boolean
canQuestBeAccepted
(int id) void
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[]
int
int
getFactionPoints
(int faction) IQuest[]
int
int
Expert users onlygetSkin()
boolean
boolean
giveItem
(IItemStack item) boolean
hasActiveQuest
(int id) boolean
hasAdvancement
(String achievement) boolean
hasFinishedQuest
(int id) boolean
hasPermission
(String permission) boolean
hasReadDialog
(int id) void
void
hideOverlay
(int id) int
Deprecated.int
inventoryItemCount
(IItemStack item) Deprecated.void
void
void
void
void
removeAllItems
(IItemStack item) void
removeDialog
(int id) boolean
removeItem
(String id, int amount) boolean
removeItem
(IItemStack item, int amount) void
removeQuest
(int id) Removes the quest from active and finished quest listvoid
void
sendMail
(IPlayerMail mail) void
sendNotification
(String title, 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) void
showCustomGui
(ICustomGui gui) Open a ICustomGui to this player.void
showDialog
(int id, String name) void
showOverlay
(IOverlay overlay) void
void
startQuest
(int id) void
stopQuest
(int id) Removes the quest from active quest listvoid
Fires trigger event for player scriptsvoid
Syncs 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, typeOf
Methods 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:IEntity
Expert users only- Specified by:
getMCEntity
in interfaceIEntity<T extends net.minecraft.server.level.ServerPlayer>
- Specified by:
getMCEntity
in 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()
-