Class EntityUtil

java.lang.Object
my.celium.org.util.EntityUtil

public final class EntityUtil extends Object
Small cohesive entity helpers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copyEquipment(net.minecraft.world.entity.LivingEntity from, net.minecraft.world.entity.LivingEntity to)
    Copies every equipment slot (armour + hands), duplicating the stacks.
    static void
    copyName(net.minecraft.world.entity.Entity from, net.minecraft.world.entity.Entity to)
    Copies the custom name and its visibility flag.
    static <T extends net.minecraft.world.entity.Entity>
    List<T>
    getNearbyEntities(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos center, double radius, Class<T> type)
     
    static <T extends net.minecraft.world.entity.Entity>
    List<T>
    getNearbyEntities(net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity center, double radius, Class<T> type)
     
    static List<net.minecraft.world.entity.player.Player>
    getNearbyPlayers(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos center, double radius)
     
    static boolean
    isMob(net.minecraft.world.entity.Entity entity)
     
    static void
    persist(net.minecraft.world.entity.Mob mob)
    Marks a mob persistent so it never despawns.

    Methods inherited from class Object

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

    • getNearbyEntities

      public static <T extends net.minecraft.world.entity.Entity> List<T> getNearbyEntities(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos center, double radius, Class<T> type)
    • getNearbyEntities

      public static <T extends net.minecraft.world.entity.Entity> List<T> getNearbyEntities(net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity center, double radius, Class<T> type)
    • getNearbyPlayers

      public static List<net.minecraft.world.entity.player.Player> getNearbyPlayers(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos center, double radius)
    • isMob

      public static boolean isMob(net.minecraft.world.entity.Entity entity)
    • copyEquipment

      public static void copyEquipment(net.minecraft.world.entity.LivingEntity from, net.minecraft.world.entity.LivingEntity to)
      Copies every equipment slot (armour + hands), duplicating the stacks.
    • copyName

      public static void copyName(net.minecraft.world.entity.Entity from, net.minecraft.world.entity.Entity to)
      Copies the custom name and its visibility flag.
    • persist

      public static void persist(net.minecraft.world.entity.Mob mob)
      Marks a mob persistent so it never despawns.