diff --git a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/EntityUtils.java b/src/main/java/org/auioc/mcmod/arnicalib/utils/game/EntityUtils.java index 172b2a58..dbbcb5bd 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/EntityUtils.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/utils/game/EntityUtils.java @@ -4,6 +4,7 @@ import java.util.function.Function; import java.util.function.Predicate; import javax.annotation.Nullable; +import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntitySelector; import net.minecraft.world.entity.LivingEntity; @@ -19,6 +20,15 @@ public class EntityUtils { + /*================================================================================================================*/ + // #region Teleport + + public static void teleportTo(Entity entity, BlockPos pos) { + entity.teleportTo(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D); + } + + // #endregion Teleport + /*================================================================================================================*/ // #region RayTrace