Module gomint.api

Interface EntityLiving

    • Method Detail

      • setHealth

        void setHealth​(float amount)
        Set entity health
        Parameters:
        amount - of health this entity has. setting to <= 0 kills the entity
      • getHealth

        float getHealth()
        Get the amount of health this entity has
        Returns:
        health of entity
      • setMaxHealth

        void setMaxHealth​(float amount)
        Set the maximum amount of health this entity can have
        Parameters:
        amount - of health this entity can have as a max
      • getMaxHealth

        float getMaxHealth()
        Get the maximum amount of health this entity can have
        Returns:
        maximum amount of health this entity can have
      • getLastDamageSource

        EntityDamageEvent.DamageSource getLastDamageSource()
        Get the entities last damage source
        Returns:
        damage soruce or null when not damaged
      • setAbsorptionHearts

        void setAbsorptionHearts​(float amount)
        Set the amount of damage which can be absorbed
        Parameters:
        amount - of damage which should be absorbed
      • getAbsorptionHearts

        float getAbsorptionHearts()
        Get the amount of damage which can be absorbed
        Returns:
        amount of damage which can be absorbed
      • addEffect

        Effect addEffect​(PotionEffect effect,
                         int amplifier,
                         long duration,
                         TimeUnit timeUnit)
        Add a new effect to the player. If the player already has a effect active the newer one gets taken.
        Parameters:
        effect - which should be applied
        amplifier - with which this effect should be calculated
        duration - of the effect, will be used in combination with the time unit
        timeUnit - which should be used in combination with the duration
        Returns:
        the added effect
      • hasEffect

        boolean hasEffect​(PotionEffect effect)
        Does a player have the given effect?
        Parameters:
        effect - which should be checked for
        Returns:
        true when the player has the effect, false when not
      • getEffectAmplifier

        int getEffectAmplifier​(PotionEffect effect)
        Get the effect amplifier
        Parameters:
        effect - for which we want to know the amplifier
        Returns:
        amplifier of effect or -1 if effect is not active
      • removeEffect

        void removeEffect​(PotionEffect effect)
        Remove the given effect from the player
        Parameters:
        effect - which should be removed
      • removeAllEffects

        void removeAllEffects()
        Remove all effects from this entity
      • getMovementSpeed

        float getMovementSpeed()
        Get the movement speed of this entity
        Returns:
        movement speed
      • setMovementSpeed

        void setMovementSpeed​(float value)
        Set movement speed of this entity
        Parameters:
        value - of the new movement speed
      • attack

        void attack​(float damage,
                    EntityDamageEvent.DamageSource source)
        Attack given entity
        Parameters:
        damage - amount which should be dealt
        source - of the damage, controls armor calcs etc.
      • setBurning

        void setBurning​(long duration,
                        TimeUnit unit)
        Set entity on fire for given amount of seconds
        Parameters:
        duration - for how long this entity should be on fire
        unit - with which the duration should be multiplied
      • extinguish

        void extinguish()
        Extinguish this entity