Class EntityHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.EntityHelper

public class EntityHelper extends Object
Helper methods for entity movement.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static double
    getMotion(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.CompoundTag
    getPersistentData(net.minecraft.world.entity.player.Player player)
     
    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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityHelper

      public EntityHelper()
  • Method Details

    • getMotion

      public static double getMotion(net.minecraft.world.entity.Entity entity, EnumRotation axis)
      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

      public 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)
    • getPersistentData

      public static net.minecraft.nbt.CompoundTag getPersistentData(net.minecraft.world.entity.player.Player player)