Module gomint.api

Interface EntityPlayer

    • Method Detail

      • setGamemode

        void setGamemode​(Gamemode gamemode)
        Set the new gamemode for this player
        Parameters:
        gamemode - The new gamemode to be used
      • getGamemode

        Gamemode getGamemode()
        Get the current gamemode
        Returns:
        The gamemode the player is in
      • isOp

        boolean isOp()
        Is this player op'ed?
        Returns:
        true when op'ed, false when not
      • setOp

        void setOp​(boolean value)
        Set the player's operator status
        Parameters:
        value -
      • hidePlayer

        void hidePlayer​(EntityPlayer player)
        Hide another player from this player
        Parameters:
        player - The player which should be hidden
      • showPlayer

        void showPlayer​(EntityPlayer player)
        Show a hidden player again
        Parameters:
        player - The player which should be shown again
      • isHidden

        boolean isHidden​(EntityPlayer player)
        Check if given player is hidden to this player
        Parameters:
        player - The player which should be checked for
        Returns:
        true if this player can't see the player given, false it it can
      • openInventory

        void openInventory​(Inventory inventory)
        Opens a inventory for the player
        Parameters:
        inventory - which should be opened
      • closeInventory

        void closeInventory​(Inventory inventory)
        Close the given inventory
        Parameters:
        inventory - which should be closed
      • sendMessage

        void sendMessage​(String message)
        Send a message to the client, this uses the normal ChatType enum.
        Parameters:
        message - which should be send to the client
      • sendMessage

        void sendMessage​(ChatType type,
                         String... message)
        Send a message with a given type to the client
        Parameters:
        message - which should be send
        type - of the message
      • hasPermission

        boolean hasPermission​(String permission)
        Check if player has a specific permission
        Parameters:
        permission - which should be checked for
        Returns:
        true if the player has this permission, false if not
      • getViewDistance

        int getViewDistance()
        Get the view distance of this player
        Returns:
        radius of chunks this player can see
      • transfer

        void transfer​(String host,
                      int port)
        Transfer player to another server
        Parameters:
        host - IP or Hostname for the user to connect to
        port - Of the new Server
      • getPing

        int getPing()
        Return the network latency
        Returns:
        network latency in ms
      • showForm

        <R> FormListener<R> showForm​(Form<R> form)
        Display new form and get a listener for the response
        Type Parameters:
        R - type of return value from the response
        Parameters:
        form - which should be shown
        Returns:
        form listener to attaching for response
      • setSettingsForm

        <R> FormListener<R> setSettingsForm​(Form<R> form)
        Set the server settings form
        Type Parameters:
        R - type of return value from the response
        Parameters:
        form - which will be set as the new settings form
        Returns:
        form listener to attaching for response
      • removeSettingsForm

        void removeSettingsForm()
        Remove the current stored settings form
      • getPermissionManager

        PermissionManager getPermissionManager()
        Get the players permission manager
        Returns:
        permission manager
      • isOnline

        boolean isOnline()
        Is this player still online?
        Returns:
        true if online, false if not
      • getLocale

        Locale getLocale()
        Locale of this player
        Returns:
        locale of the players client
      • disconnect

        void disconnect​(String reason)
        Disconnect a player for the given reason
        Parameters:
        reason - for disconnect
      • getXP

        int getXP()
        Get absolute amount of xp in this entity
        Returns:
        absolute amount of xp
      • getXPPercentage

        float getXPPercentage()
        Percentage of xp for next level
        Returns:
        percentage of next level
      • setXP

        void setXP​(int xp)
        Set the amount of xp this entity has
        Parameters:
        xp - of this entity
      • getLevel

        int getLevel()
        Get exp level of this entity
        Returns:
        exp level
      • setLevel

        void setLevel​(int level)
        Set the level of the exp bar
        Parameters:
        level - of this entity
      • playSound

        void playSound​(Vector location,
                       Sound sound,
                       byte pitch,
                       SoundData data)
        Play a sound for this player
        Parameters:
        location - of the sound in the client
        sound - The sound which should be played
        pitch - The pitch at which the sound should be played
        data - additional data for the sound
      • playSound

        void playSound​(Vector location,
                       Sound sound,
                       byte pitch)
        Play a sound for this player
        Parameters:
        location - of the sound in the client
        sound - The sound which should be played
        pitch - The pitch at which the sound should be played
      • sendParticle

        void sendParticle​(Vector location,
                          Particle particle)
        Send a particle to this player
        Parameters:
        location - of the particle in the client
        particle - which should be send
      • sendParticle

        void sendParticle​(Vector location,
                          Particle particle,
                          ParticleData data)
        Send a particle to this player
        Parameters:
        location - of the particle in the client
        particle - which should be send
        data - which should be used to construct additional data needed to display the particle
      • setAllowFlight

        void setAllowFlight​(boolean value)
        Allow flying for the client
        Parameters:
        value - if true the client can fly, if false the client can't fly
      • getAllowFlight

        boolean getAllowFlight()
        Get the setting for allowing flight
        Returns:
        true when the player can fly, false when not
      • setFlying

        void setFlying​(boolean value)
        Set flying state of the player
        Parameters:
        value - if true the player is flying, if false the player doesn't fly
      • getFlying

        boolean getFlying()
        Check if this player is flying
        Returns:
        true when flying otherwise false
      • sendTitle

        void sendTitle​(String title,
                       String subtitle,
                       long fadein,
                       long duration,
                       long fadeout,
                       TimeUnit unit)
        Send a title text to the user's screen, with an optional subtitle.
        Parameters:
        title - Big text displayed in the middle of the screen
        subtitle - Smaller text displayed below the title text
        fadein - duration for the fade in effect
        duration - which is used for how long the title should be shown
        fadeout - duration for the fade out effect
        unit - of duration multiplier
      • sendTitle

        void sendTitle​(String title)
        Send a title without subtitle.
        Parameters:
        title - Big text displayed in the middle of the screen
      • sendTitle

        void sendTitle​(String title,
                       String subtitle)
        Send a title with title and subtitle.
        Parameters:
        title - Big text displayed in the middle of the screen
        subtitle - Smaller text displayed below the title text

        Default time for fadein and duration is 1 second

      • setGliding

        void setGliding​(boolean value)
        Toggle gliding status of the player
        Parameters:
        value - true for gliding, false for not gliding
      • isGliding

        boolean isGliding()
        Is the player currently gliding?
        Returns:
        true when gliding, false when not
      • getDeviceInfo

        DeviceInfo getDeviceInfo()
        Get information about the device the player is using
        Returns:
        device information from this player
      • dispatchCommand

        CommandOutput dispatchCommand​(String command)
        Disptach a command for this player
        Parameters:
        command - which should be dispatched
        Returns:
        the output of this command
      • setSpawnLocation

        void setSpawnLocation​(Location spawnLocation)
        Update the players spawn position. It will be used in sending first chunks (when set in PlayerPreJoinEvent. The spawn location is always in the world the player currently is in. So when the player changes the world the spawn location stays.
        Parameters:
        spawnLocation - which should be used for this player
      • getSpawnLocation

        Location getSpawnLocation()
        Get the location of the spawn
        Returns:
        location of spawn
      • setScoreboard

        void setScoreboard​(Scoreboard scoreboard)
        Set a new scoreboard
        Parameters:
        scoreboard - which should be displayed to this player
      • getScoreboard

        Scoreboard getScoreboard()
        Get the current scoreboard of a player
        Returns:
        the scoreboard of this player or null
      • removeScoreboard

        void removeScoreboard()
        Remove the current scoreboard