Module gomint.api

Interface Entity

    • Method Detail

      • getEntityId

        long getEntityId()
        Gets the entity's unqiue identifier.
        Returns:
        The entity's unique identifier
      • getWorld

        World getWorld()
        Gets the world the entity resides in.
        Returns:
        The world the entity resides in
      • getLocation

        Location getLocation()
        Gets the location of the entity.
        Returns:
        The entity's location
      • getPositionX

        float getPositionX()
        Get current x axis position
        Returns:
        position on x axis
      • getPositionY

        float getPositionY()
        Get current y axis position
        Returns:
        position on y axis
      • getPositionZ

        float getPositionZ()
        Get current z axis position
        Returns:
        position on z axis
      • getPitch

        float getPitch()
        Get current pitch
        Returns:
        current pitch
      • setPitch

        void setPitch​(float pitch)
        Set the entity pitch
        Parameters:
        pitch - which should be set
      • getYaw

        float getYaw()
        Get current yaw
        Returns:
        current yaw
      • setYaw

        void setYaw​(float yaw)
        Set yaw of the entity
        Parameters:
        yaw - which should be set
      • getHeadYaw

        float getHeadYaw()
        Get current head yaw
        Returns:
        current head yaw
      • setHeadYaw

        void setHeadYaw​(float yaw)
        Set head yaw of the entity
        Parameters:
        yaw - of the entity
      • setVelocity

        void setVelocity​(Vector velocity)
        Set a entities velocity
        Parameters:
        velocity - to set
      • getVelocity

        Vector getVelocity()
        Get current applied velocity
        Returns:
        applied velocity
      • getNameTag

        String getNameTag()
        Get the name tag of this entity

        The name tag is shown above the entity in the client

        Returns:
        The name tag of the entity
      • setNameTag

        void setNameTag​(String nameTag)
        Set the name tag of this entity

        The name tag is shown above the entity in the client

        Parameters:
        nameTag - The new name tag of this entity
      • setNameTagAlwaysVisible

        void setNameTagAlwaysVisible​(boolean value)
        Set name tag to always visible even when not looking at it
        Parameters:
        value - true for always visible, otherwise false
      • isNameTagAlwaysVisible

        boolean isNameTagAlwaysVisible()
      • setNameTagVisible

        void setNameTagVisible​(boolean value)
      • isNameTagVisible

        boolean isNameTagVisible()
      • isOnGround

        boolean isOnGround()
      • isDead

        boolean isDead()
        Get the dead status of this entity
        Returns:
        true when dead, false when alive
      • spawn

        void spawn​(Location location)
        Spawn this entity
        Parameters:
        location - where the entity should spawn
      • teleport

        void teleport​(Location to)
        Teleport to the given location
        Parameters:
        to - The location where the entity should be teleported to
      • despawn

        void despawn()
        Despawn this entity on the next tick
      • getDirection

        Vector getDirection()
        Gets the direction the entity's body is facing as a normalized vector. Note, though, that pitch rotation is considered to be part of the entity's head and is thus not included inside the vector returned by this function.
        Returns:
        The direction vector the entity's body is facing
      • getDirectionPlane

        Vector2 getDirectionPlane()
        Get a vector in which direction the entity is looking
        Returns:
        vector which shows in which direction the entity is looking
      • setAge

        void setAge​(long duration,
                    TimeUnit unit)
        Set the age of this entity. This can be used to control automatic despawning.
        Parameters:
        duration - which will be multiplied with the given unit
        unit - of time
      • setTicking

        void setTicking​(boolean value)
        Disable ticking of this entity. This causes the given entity to stop moving, it also stops decaying, aging and all the other stuff which requires ticking.
        Parameters:
        value - true when the entity should tick, false when not
      • isTicking

        boolean isTicking()
        Check if this entity is currently allow to tick.
        Returns:
        true when ticking, false when not
      • getBossBar

        BossBar getBossBar()
        Create if needed and return the entities boss bar
        Returns:
        boss bar of this entity
      • setScale

        void setScale​(float scale)
        Set the scale of this entity
        Parameters:
        scale - which should be used (defaults to 1)
      • getScale

        float getScale()
        Get the scale of this entity
        Returns:
        scale of this entity
      • setHiddenByDefault

        void setHiddenByDefault​(boolean value)
        Set hidden by default. This decides if the entity is spawned to the players normally or if vision control is done with showFor(EntityPlayer) and hideFor(EntityPlayer). This has NO effect on EntityPlayer entities.
        Parameters:
        value - true when the server shouldn't broadcast packets for this entity (no movement, spawning etc). when the value was false and will be set to true all players will despawn the entity, except those who already have showFor(EntityPlayer) called before setting this.
      • showFor

        void showFor​(EntityPlayer player)
        Show this entity for the given player. This only works when setHiddenByDefault(boolean) has been set to true. This has NO effect on EntityPlayer entities.
        Parameters:
        player - for which this entity should be shown
      • hideFor

        void hideFor​(EntityPlayer player)
        Hide this entity for the given player. This only works when setHiddenByDefault(boolean) has been set to true. This has NO effect on EntityPlayer entities.
        Parameters:
        player - for which this entity should be hidden
      • getEyeHeight

        float getEyeHeight()
        Get eye height of entity
        Returns:
        eye height
      • interact

        void interact​(EntityPlayer player,
                      Vector clickVector)
        Handle a entity interaction from a player
        Parameters:
        player - the player which has interacted with the entity
      • resetFallDistance

        void resetFallDistance()
        Reset the fall distance of this entity. This will prevent a entity getting damaged when it hits the ground when it was high enough before (it needs to fall at least 3 blocks to get any damage from falling)
      • setInvisible

        void setInvisible​(boolean value)
        Set the entity invisible for others
        Parameters:
        value - true when this entity should be invisible, false when not
      • isInvisible

        boolean isInvisible()
        Is the entity invisible?
        Returns:
        true if invisible, false if not
      • setImmobile

        void setImmobile​(boolean value)
        Set this entity immobile
        Parameters:
        value - true if immobile, false if not
      • isImmobile

        boolean isImmobile()
        Is the entity immobile?
        Returns:
        true if immobile, false if not
      • setOnFire

        void setOnFire​(boolean value)
        Set this entity on fire (it does not get damage, only visual)
        Parameters:
        value - true for on fire, false for not
      • isOnFire

        boolean isOnFire()
        Check if entity is on fire
        Returns:
        true when on fire, false when not
      • setAffectedByGravity

        void setAffectedByGravity​(boolean value)
        Is this entity affected by gravity?
        Parameters:
        value - true for yes, false for no
      • isAffectedByGravity

        boolean isAffectedByGravity()
        Is this entity affected by gravity?
        Returns:
        true for yes, false for no
      • getFallDistance

        float getFallDistance()
        Get the fall distance
        Returns:
        current fall distance
      • getChunk

        Chunk getChunk()
        Get the chunk this entity is currently in
        Returns:
        the chunk in which the entity is