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 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

      void showDialog(int id, String name)
      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 id
      points - The points to increase. Use negative values to decrease
    • getFactionPoints

      int getFactionPoints(int faction)
      Parameters:
      faction - The faction id
      Returns:
      points
    • message

      void message(String message)
    • getGamemode

      int getGamemode()
    • setGamemode

      void setGamemode(int mode)
    • inventoryItemCount

      int inventoryItemCount(IItemStack item)
      Deprecated.
      Use getInventory().count instead
    • inventoryItemCount

      int inventoryItemCount(String id)
      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

      boolean removeItem(IItemStack item, int amount)
      Parameters:
      item - The Item type to be removed
      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
    • removeItem

      boolean removeItem(String id, int amount)
      Parameters:
      id - The items name
      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

      void removeAllItems(IItemStack item)
    • giveItem

      boolean giveItem(IItemStack item)
      Parameters:
      item - Item to be added
      Returns:
      Returns whether or not it gave the item succesfully
    • giveItem

      boolean giveItem(String id, int amount)
      Parameters:
      id - The items name
      amount - 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 position
      y - The y position
      z - The z position
    • resetSpawnpoint

      void resetSpawnpoint()
    • hasAdvancement

      boolean hasAdvancement(String achievement)
      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

      boolean hasPermission(String permission)
    • getPixelmonData

      Object getPixelmonData()
    • getTimers

      ITimers getTimers()
    • closeGui

      void closeGui()
    • getMCEntity

      T getMCEntity()
      Description copied from interface: IEntity
      Expert users only
      Specified by:
      getMCEntity in interface IEntity<T extends net.minecraft.server.level.ServerPlayer>
      Specified by:
      getMCEntity in interface IEntityLiving<T extends net.minecraft.server.level.ServerPlayer>
      Returns:
      Returns minecrafts entity
    • getSpawnPoint

      IBlock getSpawnPoint()
    • setSpawnPoint

      void setSpawnPoint(IBlock block)
    • getHunger

      int getHunger()
    • setHunger

      void setHunger(int level)
    • kick

      void kick(String message)
      Parameters:
      message - The message the player gets when kicked
    • sendNotification

      void sendNotification(String title, String msg, int type)
      Parameters:
      title - Title of the notification
      msg - Message of the notification
      type - (0-3) notification background type
    • sendMail

      void sendMail(IPlayerMail mail)
    • 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(String sound, float volume, float pitch)
      Parameters:
      sound - Sounds resource name
      volume - default 1
      pitch - default 1
    • playMusic

      void playMusic(String sound, boolean background, boolean loops)
      Parameters:
      sound - Sounds resource name
      background - Whether to play the music in the background or like a jukebox in a specific location
      loops - 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

      void showCustomGui(ICustomGui gui)
      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

      void trigger(int id, Object... arguments)
      Fires trigger event for player scripts
      Parameters:
      id - , Id for the event
      arguments - , arguments you can give with it
    • showOverlay

      void showOverlay(IOverlay overlay)
    • hideOverlay

      void hideOverlay(int id)
    • hideAllOverlays

      void hideAllOverlays()
    • getSkin

      IPlayerSkin getSkin()