Class EntityUtil
java.lang.Object
my.celium.org.util.EntityUtil
Small cohesive entity helpers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyEquipment(net.minecraft.world.entity.LivingEntity from, net.minecraft.world.entity.LivingEntity to) Copies every equipment slot (armour + hands), duplicating the stacks.static voidcopyName(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 booleanisMob(net.minecraft.world.entity.Entity entity) static voidpersist(net.minecraft.world.entity.Mob mob) Marks a mob persistent so it never despawns.
-
Method Details
-
getNearbyEntities
-
getNearbyEntities
-
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.
-