Interface IPlayer<T extends net.minecraft.entity.player.EntityPlayerMP>

    • Method Detail

      • getDisplayName

        java.lang.String getDisplayName()
        Returns:
        Returns the displayed name of the player
      • getName

        java.lang.String getName()
        Returns:
        Returns the player's name
      • kick

        void kick​(java.lang.String reason)
        Kicks the player from the server with the specified reason.
        Parameters:
        reason - The reason for kicking the player.
      • setPosition

        void setPosition​(double x,
                         double y,
                         double z)
        Teleports the player to the specified coordinates in the current dimension.
        Specified by:
        setPosition in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Parameters:
        x - The x-coordinate.
        y - The y-coordinate.
        z - The z-coordinate.
      • setPosition

        void setPosition​(IPos pos)
        Teleports the player to the coordinates specified by the given position.
        Specified by:
        setPosition in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Parameters:
        pos - The position object containing coordinates.
      • setPosition

        void setPosition​(double x,
                         double y,
                         double z,
                         int dimensionId)
        Teleports the player to the specified coordinates in the given dimension.
        Parameters:
        x - The x-coordinate.
        y - The y-coordinate.
        z - The z-coordinate.
        dimensionId - The dimension ID.
      • setPosition

        void setPosition​(IPos pos,
                         int dimensionId)
        Teleports the player to the position in the specified dimension.
        Parameters:
        pos - The position object containing coordinates.
        dimensionId - The dimension ID.
      • setPosition

        void setPosition​(double x,
                         double y,
                         double z,
                         IWorld world)
        Teleports the player to the specified coordinates in the dimension of the provided world.
        Parameters:
        x - The x-coordinate.
        y - The y-coordinate.
        z - The z-coordinate.
        world - The world whose dimension will be used.
      • setPosition

        void setPosition​(IPos pos,
                         IWorld world)
        Teleports the player to the position specified by the given position in the dimension of the provided world.
        Parameters:
        pos - The position object containing coordinates.
        world - The world whose dimension will be used.
      • setDimension

        void setDimension​(int dimension)
        Changes the player's dimension by teleporting them to their current position in the specified dimension.
        Specified by:
        setDimension in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Parameters:
        dimension - The dimension ID to move the player to.
      • getHunger

        int getHunger()
        Returns:
        Returns the player's current hunger level.
      • setHunger

        void setHunger​(int hunger)
        Sets the player's hunger level.
        Parameters:
        hunger - The new hunger level.
      • getSaturation

        float getSaturation()
        Returns:
        Returns the player's current saturation level.
      • setSaturation

        void setSaturation​(float saturation)
        Sets the player's saturation level.
        Parameters:
        saturation - The new saturation level.
      • showDialog

        void showDialog​(IDialog dialog)
        Displays the specified dialog to the player.
        Parameters:
        dialog - The dialog to display.
      • hasReadDialog

        boolean hasReadDialog​(IDialog dialog)
        Checks whether the player has read the specified dialog.
        Parameters:
        dialog - The dialog to check.
        Returns:
        True if the dialog has been read, false otherwise.
      • readDialog

        void readDialog​(IDialog dialog)
        Marks the specified dialog as read for the player.
        Parameters:
        dialog - The dialog to mark as read.
      • unreadDialog

        void unreadDialog​(IDialog dialog)
        Marks the specified dialog as unread for the player.
        Parameters:
        dialog - The dialog to mark as unread.
      • showDialog

        void showDialog​(int id)
        Displays the dialog with the specified ID to the player.
        Parameters:
        id - The dialog ID.
      • hasReadDialog

        boolean hasReadDialog​(int id)
        Checks whether the player has read the dialog with the specified ID.
        Parameters:
        id - The dialog ID.
        Returns:
        True if the dialog has been read, false otherwise.
      • readDialog

        void readDialog​(int id)
        Marks the dialog with the specified ID as read for the player.
        Parameters:
        id - The dialog ID.
      • unreadDialog

        void unreadDialog​(int id)
        Marks the dialog with the specified ID as unread for the player.
        Parameters:
        id - The dialog ID.
      • hasFinishedQuest

        boolean hasFinishedQuest​(IQuest quest)
        Checks whether the player has finished the specified quest.
        Parameters:
        quest - The quest to check.
        Returns:
        True if the quest has been finished, false otherwise.
      • hasActiveQuest

        boolean hasActiveQuest​(IQuest quest)
        Checks whether the player has an active quest matching the specified quest.
        Parameters:
        quest - The quest to check.
        Returns:
        True if the quest is active, false otherwise.
      • startQuest

        void startQuest​(IQuest quest)
        Add the quest from active quest list.
        Parameters:
        quest - The quest.
      • finishQuest

        void finishQuest​(IQuest quest)
        Add the quest from finished quest list.
        Parameters:
        quest - The quest.
      • stopQuest

        void stopQuest​(IQuest quest)
        Removes the quest from active quest list.
        Parameters:
        quest - The quest.
      • removeQuest

        void removeQuest​(IQuest quest)
        Removes the quest from active and finished quest list.
        Parameters:
        quest - The quest.
      • hasFinishedQuest

        boolean hasFinishedQuest​(int id)
        Checks whether the player has finished the quest with the given ID.
        Parameters:
        id - The quest ID.
        Returns:
        True if the quest has been finished, false otherwise.
      • hasActiveQuest

        boolean hasActiveQuest​(int id)
        Checks whether the player has an active quest with the given ID.
        Parameters:
        id - The quest ID.
        Returns:
        True if the quest is active, false otherwise.
      • startQuest

        void startQuest​(int id)
        Parameters:
        id - The quest ID.
      • finishQuest

        void finishQuest​(int id)
        Parameters:
        id - The quest ID.
      • stopQuest

        void stopQuest​(int id)
        Parameters:
        id - The quest ID.
      • removeQuest

        void removeQuest​(int id)
        Parameters:
        id - The quest ID.
      • getFinishedQuests

        IQuest[] getFinishedQuests()
        Returns an array of quests that the player has finished.
        Returns:
        An array of finished quests.
      • getType

        int getType()
        Returns the entity type identifier for the player.
        Specified by:
        getType in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Specified by:
        getType in interface IEntityLivingBase<T extends net.minecraft.entity.player.EntityPlayerMP>
        Returns:
        The type as an integer.
      • typeOf

        boolean typeOf​(int type)
        Checks if the player is of the specified entity type.
        Specified by:
        typeOf in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Specified by:
        typeOf in interface IEntityLivingBase<T extends net.minecraft.entity.player.EntityPlayerMP>
        Parameters:
        type - The entity type to check.
        Returns:
        True if the player is of the specified type, false otherwise.
      • addFactionPoints

        void addFactionPoints​(int faction,
                              int points)
        Parameters:
        faction - The faction id.
        points - The points to increase. Use negative values to decrease.
      • setFactionPoints

        void setFactionPoints​(int faction,
                              int points)
        Parameters:
        faction - The faction id.
        points - The new point value for this faction.
      • getFactionPoints

        int getFactionPoints​(int faction)
        Parameters:
        faction - The faction id.
        Returns:
        The current point total for the faction.
      • sendMessage

        void sendMessage​(java.lang.String message)
        Sends a chat message to the player.
        Parameters:
        message - The message you want to send. Compatible with formatting codes.
        See Also:
        Minecraft formatting codes
      • getMode

        int getMode()
        Returns:
        Returns gamemode. 0: Survival, 1: Creative, 2: Adventure.
      • setMode

        void setMode​(int type)
        Parameters:
        type - The gamemode type. 0:SURVIVAL, 1:CREATIVE, 2:ADVENTURE.
      • getInventory

        IItemStack[] getInventory()
        Returns:
        Returns an IItemStack array of size 36 representing the player's inventory.
        Since:
        1.7.10d
      • inventoryItemCount

        int inventoryItemCount​(IItemStack item,
                               boolean ignoreNBT,
                               boolean ignoreDamage)
        Parameters:
        item - The item to be checked.
        ignoreNBT - Whether the item's NBT tags will be checked for equality.
        ignoreDamage - Whether the item's damage will be checked for equality.
        Returns:
        The total count of the specified item in the player's inventory.
      • removeItem

        boolean removeItem​(java.lang.String id,
                           int damage,
                           int amount)
        Parameters:
        id - The item's name.
        damage - The damage value.
        amount - How many items will be removed.
        Returns:
        True if the items were removed successfully, false if the amount exceeds what the player has or the item doesn't exist.
        Since:
        1.7.10c
      • removeItem

        boolean removeItem​(IItemStack item,
                           int amount,
                           boolean ignoreNBT,
                           boolean ignoreDamage)
        Parameters:
        item - The item type to be removed.
        amount - The number of items to remove.
        ignoreNBT - Whether the item's NBT tags will be checked for equality.
        ignoreDamage - Whether the item's damage will be checked for equality.
        Returns:
        True if the items were removed successfully, false if the removal amount exceeds the player's count.
      • removeAllItems

        int removeAllItems​(IItemStack item,
                           boolean ignoreNBT,
                           boolean ignoreDamage)
        Parameters:
        item - The item to be removed from the player's inventory.
        ignoreNBT - Whether the item's NBT tags will be checked for equality.
        ignoreDamage - Whether the item's damage will be checked for equality.
        Returns:
        The number of item stacks that were removed.
      • giveItem

        boolean giveItem​(IItemStack item,
                         int amount)
        Parameters:
        item - The item to be added.
        amount - The number of items to add.
        Returns:
        True if the item was given successfully, false otherwise.
        Since:
        1.7.10c
      • giveItem

        boolean giveItem​(java.lang.String id,
                         int damage,
                         int amount)
        Parameters:
        id - The item's name.
        damage - The damage value.
        amount - The number of items to add.
        Returns:
        True if the item was given successfully, false otherwise.
        Since:
        1.7.10c
      • setSpawnpoint

        void setSpawnpoint​(int x,
                           int y,
                           int z)
        Same as the /spawnpoint command.
        Parameters:
        x - The x-coordinate.
        y - The y-coordinate.
        z - The z-coordinate.
      • setSpawnpoint

        void setSpawnpoint​(IPos pos)
        Sets the player's spawnpoint to the coordinates of the provided position.
        Parameters:
        pos - The position containing the spawn coordinates.
      • resetSpawnpoint

        void resetSpawnpoint()
        Resets the player's spawnpoint to the default spawn.
      • setRotation

        void setRotation​(float rotationYaw,
                         float rotationPitch)
        Sets the player's rotation.
        Specified by:
        setRotation in interface IEntity<T extends net.minecraft.entity.player.EntityPlayerMP>
        Parameters:
        rotationYaw - The horizontal rotation (yaw).
        rotationPitch - The vertical rotation (pitch).
      • disableMouseInput

        void disableMouseInput​(long time,
                               int... buttonIds)
        Disables mouse input for the specified time and buttons for the player.
        Parameters:
        time - The duration for which mouse input is disabled.
        buttonIds - The IDs of the mouse buttons to disable.
      • stopUsingItem

        void stopUsingItem()
        Stops the player from using the currently active item.
      • clearItemInUse

        void clearItemInUse()
        Clears the currently in-use item.
      • clearInventory

        void clearInventory()
        Clears the player's entire inventory, including main and armor slots.
      • playSound

        void playSound​(java.lang.String name,
                       float volume,
                       float pitch)
        Plays the specified sound at the given volume and pitch for the player.
        Parameters:
        name - The sound name.
        volume - The volume level.
        pitch - The pitch level.
      • playSound

        void playSound​(int id,
                       ISound sound)
        Plays the specified sound with an identifier for the player.
        Parameters:
        id - The sound identifier.
        sound - The sound to play.
      • playSound

        void playSound​(ISound sound)
        Plays the specified sound for the player.
        Parameters:
        sound - The sound to play.
      • stopSound

        void stopSound​(int id)
        Stops the sound with the given identifier for the player.
        Parameters:
        id - The sound identifier.
      • pauseSounds

        void pauseSounds()
        Pauses all sounds currently playing for the player.
      • continueSounds

        void continueSounds()
        Resumes paused sounds for the player.
      • stopSounds

        void stopSounds()
        Stops all sounds currently playing for the player.
      • mountEntity

        void mountEntity​(net.minecraft.entity.Entity ridingEntity)
        Mounts the specified entity onto the player.
        Parameters:
        ridingEntity - The entity to mount.
      • dropOneItem

        IEntity dropOneItem​(boolean dropStack)
        Drops one item from the player's inventory.
        Parameters:
        dropStack - If true, drops the entire stack; otherwise, drops a single item.
        Returns:
        The dropped item as an IEntity.
      • canHarvestBlock

        boolean canHarvestBlock​(IBlock block)
        Checks if the player can harvest the specified block.
        Parameters:
        block - The block to check.
        Returns:
        True if the player can harvest the block, false otherwise.
      • interactWith

        boolean interactWith​(IEntity entity)
        Interacts with the specified entity.
        Parameters:
        entity - The entity to interact with.
        Returns:
        True if the interaction was successful, false otherwise.
      • hasAchievement

        boolean hasAchievement​(java.lang.String achievement)
        Parameters:
        achievement - The achievement id. For a complete list see http://minecraft.wiki/w/Achievements
        Returns:
        Returns whether or not the player has this achievement.
      • hasBukkitPermission

        boolean hasBukkitPermission​(java.lang.String permission)
        Parameters:
        permission - Bukkit/Cauldron permission.
        Returns:
        Returns whether or not the player has the specified permission.
      • getExpLevel

        int getExpLevel()
        Returns:
        Returns the player's experience level.
        Since:
        1.7.10c
      • setExpLevel

        void setExpLevel​(int level)
        Parameters:
        level - The new experience level to set.
        Since:
        1.7.10c
      • getPixelmonData

        IPixelmonPlayerData getPixelmonData()
        Requires Pixelmon to be installed.
        Returns:
        Returns the player's Pixelmon data, or null if Pixelmon is not enabled.
        Since:
        1.7.10d
      • getTimers

        ITimers getTimers()
        Returns the player's timers.
        Returns:
        The timers associated with the player.
      • updatePlayerInventory

        void updatePlayerInventory()
        Updates the player's inventory on the client side.
      • getDBCPlayer

        IDBCPlayer getDBCPlayer()
        Returns the player's DBC (database) data, if available.
        Returns:
        The DBC data, or null if not applicable.
      • blocking

        boolean blocking()
        Checks if the player is currently blocking.
        Returns:
        True if blocking, false otherwise.
      • getData

        IPlayerData getData()
        Returns the player's associated data (quest, faction, timers, etc.).
        Returns:
        The player's data.
      • isScriptingDev

        boolean isScriptingDev()
        Checks if the player is flagged as a scripting developer.
        Returns:
        True if the player is a scripting developer, false otherwise.
      • getActiveQuests

        IQuest[] getActiveQuests()
        Returns an array of quests that the player is actively undertaking.
        Returns:
        An array of active quests.
      • getOpenContainer

        IContainer getOpenContainer()
        Returns the container (GUI) that the player currently has open, if any.
        Returns:
        The open container, or null if none is open.
      • showCustomGui

        void showCustomGui​(ICustomGui gui)
        Displays a custom GUI to the player.
        Parameters:
        gui - The custom GUI to show.
      • getCustomGui

        ICustomGui getCustomGui()
        Returns the custom GUI currently open for the player.
        Returns:
        The custom GUI, or null if none is open.
      • closeGui

        void closeGui()
        Closes the currently open GUI for the player.
      • showCustomOverlay

        void showCustomOverlay​(ICustomOverlay overlay)
        Displays a custom overlay on the player's screen.
        Parameters:
        overlay - The custom overlay to display.
      • closeOverlay

        void closeOverlay​(int id)
        Closes the custom overlay with the specified identifier.
        Parameters:
        id - The overlay ID.
      • getOverlays

        IOverlayHandler getOverlays()
        Returns the player's overlay handler which manages custom overlays.
        Returns:
        The overlay handler.
      • setConqueredEnd

        void setConqueredEnd​(boolean conqueredEnd)
        Sets whether the player has conquered the End dimension.
        Parameters:
        conqueredEnd - True if the End is conquered, false otherwise.
      • conqueredEnd

        boolean conqueredEnd()
        Checks whether the player has conquered the End dimension.
        Returns:
        True if the End has been conquered, false otherwise.
      • getScreenSize

        IScreenSize getScreenSize()
        Returns the player's screen size information.
        Returns:
        The screen size.
      • getMagicData

        IMagicData getMagicData()
        Returns the player's magic-related data.
        Returns:
        The magic data.
      • getAttributes

        IPlayerAttributes getAttributes()
        Returns the player's item attribute combination
        Returns:
        Player Attributes Data