I can't find out how to get player.getDistanceToEntity to work correctly. I'm trying to have the player attack an end crystal (this is the beginning of a crystal aura module), and I can't figure this one part out. I know this is a method (or at least I think) but I can't figure out where the method comes from/what to import.
The Error:
\
AutoCrystal.java:34: error: cannot find symbol
if (player.getDistanceToEntity(e) < crystalRange) {
^
symbol: method getDistanceToEntity(Entity)
location: variable player of type EntityPlayerSP
The code:
public class AutoCrystal extends Module
{
private final Setting crystalSpeed = new SettingBuilder(SettingType.INTEGER).withName("CrystalSpeed").withModule(this).withIntegerValue(5).withMaxIntegerValue(0).withMaxIntegerValue(10).build();
private final Setting crystalRange = new SettingBuilder(SettingType.INTEGER).withName("CrystalRange").withModule(this).withIntegerValue(5).withMaxIntegerValue(0).withMaxIntegerValue(10).build();
private long currentMS = 0L;
private long lastMS = -1L;
public void onUpdate(EntityPlayerSP player) {
if(isEnabled()) {
currentMS = System.nanoTime() / 1000000;
if(hasDelayRun((long)(1000 / crystalSpeed.getIntegerValue())))
{
for (Entity e : mc.getMinecraft().world.loadedEntityList) {
if (player.getDistanceToEntity(e) < crystalRange) {
if (e instanceof EntityEnderCrystal) {
Minecraft.getMinecraft().playerController.attackEntity(player, e);
player.swingArm(EnumHand.MAIN_HAND);
lastMS = System.nanoTime() / 1000000;
break;
}
}
}
}
}
}
I can't find out how to get player.getDistanceToEntity to work correctly. I'm trying to have the player attack an end crystal (this is the beginning of a crystal aura module), and I can't figure this one part out. I know this is a method (or at least I think) but I can't figure out where the method comes from/what to import.
The Error:
\
The code:
Any help is greatly appreciated!
bump!