Interface IEntity<T extends net.minecraft.entity.Entity>

    • Method Detail

      • spawnParticle

        void spawnParticle​(IParticle entityParticle)
        Spawns the given particle effect associated with this entity.
        Parameters:
        entityParticle - The particle effect to spawn.
      • getEntityId

        int getEntityId()
        Returns the unique entity ID.
        Returns:
        the entity ID.
      • getUniqueID

        String getUniqueID()
        Returns the unique UUID string of the entity.
        Returns:
        the unique ID.
      • getYOffset

        double getYOffset()
        Returns the vertical offset for rendering.
        Returns:
        the Y offset.
      • getWidth

        double getWidth()
        Returns:
        The entity's width.
      • getHeight

        double getHeight()
        Returns:
        The entity's height.
      • getX

        double getX()
        Returns:
        The entity's x position.
      • setX

        void setX​(double x)
        Sets the entity's x position.
        Parameters:
        x - the new x position.
      • getY

        double getY()
        Returns:
        The entity's y position.
      • setY

        void setY​(double y)
        Sets the entity's y position.
        Parameters:
        y - the new y position.
      • getZ

        double getZ()
        Returns:
        The entity's z position.
      • setZ

        void setZ​(double z)
        Sets the entity's z position.
        Parameters:
        z - the new z position.
      • getMotionX

        double getMotionX()
        Returns:
        The entity's x motion.
      • setMotionX

        void setMotionX​(double x)
        Sets the entity's x motion.
        Parameters:
        x - the new x motion.
      • getMotionY

        double getMotionY()
        Returns:
        The entity's y motion.
      • setMotionY

        void setMotionY​(double y)
        Sets the entity's y motion.
        Parameters:
        y - the new y motion.
      • getMotionZ

        double getMotionZ()
        Returns:
        The entity's z motion.
      • setMotionZ

        void setMotionZ​(double z)
        Sets the entity's z motion.
        Parameters:
        z - the new z motion.
      • setMotion

        void setMotion​(double x,
                       double y,
                       double z)
        Convenience method to set the entity's motion in all three axes.
        Parameters:
        x - the x motion.
        y - the y motion.
        z - the z motion.
      • setMotion

        void setMotion​(IPos pos)
        Sets the entity's motion based on the given position.
        Parameters:
        pos - the position containing motion components.
      • getMotion

        IPos getMotion()
        Returns the entity's current motion as an IPos object.
        Returns:
        the motion vector.
      • isAirborne

        boolean isAirborne()
        Returns:
        Whether the entity is airborne.
      • getBlockX

        int getBlockX()
        Returns:
        The block (integer) x position.
      • getBlockY

        int getBlockY()
        Returns:
        The block (integer) y position.
      • getBlockZ

        int getBlockZ()
        Returns:
        The block (integer) z position.
      • setPosition

        void setPosition​(double x,
                         double y,
                         double z)
        Sets the entity's position to the specified coordinates.
        Parameters:
        x - the x coordinate.
        y - the y coordinate.
        z - the z coordinate.
      • setPosition

        void setPosition​(IPos pos)
        Sets the entity's position using an IPos object.
        Parameters:
        pos - the position object.
      • getPosition

        IPos getPosition()
        Returns the entity's current position as an IPos object.
        Returns:
        the position.
      • getDimension

        int getDimension()
        Returns:
        The dimension ID the entity is in.
      • setDimension

        void setDimension​(int dimensionId)
        Moves the entity to the specified dimension.
        Parameters:
        dimensionId - the dimension ID.
      • getCollidingEntities

        IEntity[] getCollidingEntities()
        Returns:
        Array of entities that are colliding with this entity
      • getSurroundingEntities

        IEntity[] getSurroundingEntities​(int range)
        Returns an array of entities within the specified range.
        Parameters:
        range - the search range.
        Returns:
        an array of surrounding entities.
      • getSurroundingEntities

        IEntity[] getSurroundingEntities​(int range,
                                         int type)
        Returns an array of entities of a specified type within the given range.
        Parameters:
        range - the search range.
        type - the EntityType to find.
        Returns:
        an array of surrounding entities.
      • isAlive

        boolean isAlive()
        Returns:
        Whether the entity is alive.
      • getTempData

        Object getTempData​(String key)
        Returns temporary data stored under the given key.
        Parameters:
        key - the key.
        Returns:
        the temporary data.
      • setTempData

        void setTempData​(String key,
                         Object value)
        Stores temporary data that is cleared when the entity is unloaded.
        Parameters:
        key - the key.
        value - the value.
      • hasTempData

        boolean hasTempData​(String key)
        Checks if temporary data for the given key exists.
        Parameters:
        key - the key.
        Returns:
        true if it exists; false otherwise.
      • removeTempData

        void removeTempData​(String key)
        Removes the temporary data for the given key.
        Parameters:
        key - the key.
      • clearTempData

        void clearTempData()
        Clears all temporary data.
      • getTempDataKeys

        String[] getTempDataKeys()
        Returns an array of keys for temporary data.
        Returns:
        the keys.
      • getStoredData

        Object getStoredData​(String key)
        Returns stored (persistent) data for the given key.
        Parameters:
        key - the key.
        Returns:
        the stored data.
      • setStoredData

        void setStoredData​(String key,
                           Object value)
        Stores persistent data under the given key. Only Numbers and Strings are supported.
        Parameters:
        key - the key.
        value - the value.
      • hasStoredData

        boolean hasStoredData​(String key)
        Checks if stored data for the given key exists.
        Parameters:
        key - the key.
        Returns:
        true if it exists; false otherwise.
      • removeStoredData

        void removeStoredData​(String key)
        Removes the stored data for the given key.
        Parameters:
        key - the key.
      • clearStoredData

        void clearStoredData()
        Clears all stored data.
      • getStoredDataKeys

        String[] getStoredDataKeys()
        Returns an array of keys for stored data.
        Returns:
        the keys.
      • getAge

        long getAge()
        Returns:
        The age of the entity in ticks.
      • despawn

        void despawn()
        Permanently despawns the entity.
      • inWater

        boolean inWater()
        Returns:
        Whether the entity is standing in water.
      • inLava

        boolean inLava()
        Returns:
        Whether the entity is standing in lava.
      • inFire

        boolean inFire()
        Returns:
        Whether the entity is standing in fire.
      • isBurning

        boolean isBurning()
        Returns:
        Whether the entity is on fire.
      • setBurning

        void setBurning​(int ticks)
        Sets the entity on fire for the given number of ticks (20 ticks = 1 second).
        Parameters:
        ticks - the burn duration.
      • extinguish

        void extinguish()
        Extinguishes any fire on the entity.
      • getTypeName

        String getTypeName()
        Returns:
        The entity type name as registered in Minecraft.
      • dropItem

        void dropItem​(IItemStack item)
        Causes the entity to drop the given item.
        Parameters:
        item - the item to drop.
      • getRider

        IEntity getRider()
        Returns:
        The entity riding this entity.
      • setRider

        void setRider​(IEntity entity)
        Sets the given entity as the rider of this entity.
        Parameters:
        entity - the rider.
      • getMount

        IEntity getMount()
        Returns:
        The entity this entity is riding.
      • setMount

        void setMount​(IEntity entity)
        Sets the entity to be mounted by this entity.
        Parameters:
        entity - the mount.
      • getType

        int getType()
        Returns the EntityType as defined in the scripting constants.
        Returns:
        the EntityType.
      • typeOf

        boolean typeOf​(int type)
        Checks whether the entity is of the specified EntityType.
        Parameters:
        type - the type to check.
        Returns:
        true if the entity is of that type; false otherwise.
      • setRotation

        void setRotation​(float rotation)
        Sets the entity's rotation (yaw) in degrees (0-360).
        Parameters:
        rotation - the rotation angle.
      • setRotation

        void setRotation​(float rotationYaw,
                         float rotationPitch)
        Sets both the rotation (yaw) and pitch of the entity.
        Parameters:
        rotationYaw - the yaw angle.
        rotationPitch - the pitch angle.
      • getRotation

        float getRotation()
        Returns:
        The current rotation (yaw) of the entity.
      • setPitch

        void setPitch​(float pitch)
        Sets the entity's pitch.
        Parameters:
        pitch - the pitch angle.
      • getPitch

        float getPitch()
        Returns the entity's pitch.
        Returns:
        the pitch angle.
      • knockback

        void knockback​(int power,
                       float direction)
        Applies a knockback effect to the entity.
        Parameters:
        power - the strength of the knockback.
        direction - the direction in degrees (usually based on getRotation()).
      • knockback

        void knockback​(double xpower,
                       double ypower,
                       double zpower,
                       float direction)
        Applies knockback using individual power components.
        Parameters:
        xpower - the x-axis power.
        ypower - the y-axis power.
        zpower - the z-axis power.
        direction - the direction in degrees.
      • knockback

        void knockback​(IPos pos,
                       float direction)
        Applies knockback using a position vector.
        Parameters:
        pos - the position vector.
        direction - the direction in degrees.
      • setImmune

        void setImmune​(int ticks)
        Sets the entity's immunity time (hurt resistance).
        Parameters:
        ticks - the number of ticks.
      • setInvisible

        void setInvisible​(boolean invisible)
        Sets the entity's invisibility.
        Parameters:
        invisible - true to make invisible.
      • setSneaking

        void setSneaking​(boolean sneaking)
        Sets whether the entity is sneaking.
        Parameters:
        sneaking - true to enable sneaking.
      • setSprinting

        void setSprinting​(boolean sprinting)
        Sets whether the entity is sprinting.
        Parameters:
        sprinting - true to enable sprinting.
      • hasCollided

        boolean hasCollided()
        Returns:
        Whether the entity has collided with something.
      • hasCollidedVertically

        boolean hasCollidedVertically()
        Returns:
        Whether the entity has collided vertically.
      • hasCollidedHorizontally

        boolean hasCollidedHorizontally()
        Returns:
        Whether the entity has collided horizontally.
      • capturesDrops

        boolean capturesDrops()
        Returns:
        Whether the entity is capturing drops.
      • setCapturesDrops

        void setCapturesDrops​(boolean capture)
        Sets whether the entity captures drops.
        Parameters:
        capture - true to capture drops.
      • setCapturedDrops

        void setCapturedDrops​(IEntity<?>[] capturedDrops)
        Sets the captured drops for this entity.
        Parameters:
        capturedDrops - an array of captured drops.
      • getCapturedDrops

        IEntity<?>[] getCapturedDrops()
        Returns the captured drops.
        Returns:
        an array of captured drops.
      • isSneaking

        boolean isSneaking()
        Returns:
        Whether the entity is sneaking.
        Since:
        1.7.10c
      • isSprinting

        boolean isSprinting()
        Returns:
        Whether the entity is sprinting.
        Since:
        1.7.10c
      • getMCEntity

        T getMCEntity()
        Expert users only.
        Returns:
        The underlying Minecraft entity.
      • getNbt

        INbt getNbt()
        Returns the entity's NBT data.
        Returns:
        the NBT data.
      • getAllNbt

        INbt getAllNbt()
        Returns all NBT data for the entity.
        Returns:
        the complete NBT data.
      • setNbt

        void setNbt​(INbt nbt)
        Applies the given NBT data to the entity.
        Parameters:
        nbt - the NBT data.
      • getNbtOptional

        INbt getNbtOptional()
        Returns optional NBT data if available.
        Returns:
        the optional NBT data, or null if none.
      • storeAsClone

        void storeAsClone​(int tab,
                          String name)
        Stores the entity as a clone with the given tab and name.
        Parameters:
        tab - the tab index.
        name - the name for the clone.
      • getWorld

        IWorld getWorld()
        Returns:
        The world this entity exists in.
      • updateEntity

        void updateEntity()
        Updates the entity's state.