diff --git a/paper-api/src/main/java/org/bukkit/entity/Enderman.java b/paper-api/src/main/java/org/bukkit/entity/Enderman.java index bb325d9c80..0a03dc4379 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Enderman.java +++ b/paper-api/src/main/java/org/bukkit/entity/Enderman.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import org.bukkit.block.data.BlockData; import org.bukkit.material.MaterialData; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -39,4 +40,38 @@ public interface Enderman extends Monster { * @param blockData data to set the carried block to, or null to remove */ public void setCarriedBlock(@Nullable BlockData blockData); + + /** + * Randomly teleports the Enderman in a 64x64x64 block cuboid region. + *
+ * If the randomly selected point is in the ground, the point is moved 1 block + * down until air is found or until it goes under + * {@link org.bukkit.World#getMinHeight()}. + *
+ * This method will return false if this Enderman is not alive, or if the
+ * teleport location was obstructed, or if the teleport location is in water.
+ *
+ * @return true if the teleport succeeded.
+ */
+ @ApiStatus.Experimental
+ public boolean teleport();
+
+ /**
+ * Randomly teleports the Enderman towards the given entity
.
+ *
+ * The point is selected by drawing a vector between this enderman and the
+ * given entity
. That vector's length is set to 16 blocks.
+ * That point is then moved within a 8x8x8 cuboid region. If the randomly
+ * selected point is in the ground, the point is moved 1 block down until
+ * air is found or until it goes under
+ * {@link org.bukkit.World#getMinHeight()}.
+ *
+ * This method will return false if this Enderman is not alive, or if the + * teleport location was obstructed, or if the teleport location is in water. + * + * @param entity The entity to teleport towards. + * @return true if the teleport succeeded. + */ + @ApiStatus.Experimental + public boolean teleportTowards(@NotNull Entity entity); }