Skip to content

Commit

Permalink
feat(utils): method for teleporting entity to blockpos
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Jun 26, 2022
1 parent 660438a commit b675351
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -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;
Expand All @@ -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

Expand Down

0 comments on commit b675351

Please sign in to comment.