This is beyond my knowledge of Java... and I have no idea how to do it. Declaration of function looks like this:
default <T extends Entity> java.util.List<T> getEntitiesOfClass(java.lang.Class<? extends T> p_217357_1_, AxisAlignedBB p_217357_2_)
I can put there param like PigEntity.class or ZombieEntity.class but is there a possibility to parametrize this "java.lang.Class<? extends T> p_217357_1_" like this?
switch (sEntity)
{
case "ZOMBIE":
ent = ZombieEntity.class;
break;
case "SKELETON":
ent = SkeletonEntity.class;
break;
}
monsters = mc.level.getEntitiesOfClass(ent, new AxisAlignedBB((double)(posx - 5.0), (double)(posy - 5.0), (double)(posz - 5.0F),(double)(posx + 5.0),(double)(posy + 5),(double)(posz + 5)));
If Yes then what type "ent" and "monsters" should be?
Or maybe it should be done totally different? The idea is to be able to look for defined type of Entities within a AxisAlignedBB or Range?