Class EntityHelper
java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.EntityHelper
Helper methods for entity movement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis, double motion) Sets the motion of an entity in a particular axis relative to the world.static doublegetMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis) Gets the motion of an entity in a particular axis relative to the world.static <T extends net.minecraft.world.entity.Entity>
List<T>getNearbyEntities(Class<T> entityType, net.minecraft.world.level.Level world, double x, double y, double z, float radius) static net.minecraft.nbt.CompoundTaggetPersistentData(net.minecraft.world.entity.player.Player player) static voidsetMotion(net.minecraft.world.entity.Entity entity, double x, double y, double z) Sets the motion of an entity in a particular axis relative to the world.static voidsetMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis, double motion) Sets the motion of an entity in a particular axis relative to the world.static voidsetPosition(net.minecraft.world.entity.Entity entity, EnumRotation axis, double position) Sets the position of an entity in a particular axis relative to the world.
-
Constructor Details
-
EntityHelper
public EntityHelper()
-
-
Method Details
-
getMotion
Gets the motion of an entity in a particular axis relative to the world.- Parameters:
entity- The entity to get motion for.axis- The world axis to get motion for.- Returns:
- The entity's motion in the direction of the specified axis.
-
setMotion
public static void setMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis, double motion) Sets the motion of an entity in a particular axis relative to the world.- Parameters:
entity- The entity to set motion for.axis- The world axis to get motion for.motion- The value to set the motion to.
-
setMotion
public static void setMotion(net.minecraft.world.entity.Entity entity, double x, double y, double z) Sets the motion of an entity in a particular axis relative to the world.- Parameters:
entity- The entity to set motion for.x- X axis motion.y- Y axis motion.z- Z axis motion.
-
addMotion
public static void addMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis, double motion) Sets the motion of an entity in a particular axis relative to the world.- Parameters:
entity- The entity to get motion for.axis- The world axis to get motion for.motion- The value to set the motion to.
-
setPosition
public static void setPosition(net.minecraft.world.entity.Entity entity, EnumRotation axis, double position) Sets the position of an entity in a particular axis relative to the world.- Parameters:
entity- The entity to get position for.axis- The world axis to get position for.position- The value to set the position to.
-
getNearbyEntities
-
getPersistentData
public static net.minecraft.nbt.CompoundTag getPersistentData(net.minecraft.world.entity.player.Player player)
-