- Баллы
- 76
Здравствуйте!
У меня есть класс с методом:
Но Когда я пытаюсь в этом же класс в новом методе поставить имя этому мобу вылезает ошибка IDE:
Ошибка:
No enclosing instance of the type EntitySilverfishMob is accessible in scope
Помогите!
У меня есть класс с методом:
Код:
public EntitySilverfishMob(World world) {
super(world);
try {
Field bField = PathfinderGoalSelector.class.getDeclaredField("b");
bField.setAccessible(true);
Field cField = PathfinderGoalSelector.class.getDeclaredField("c");
cField.setAccessible(true);
bField.set(this.goalSelector, Sets.newLinkedHashSet());
bField.set(this.targetSelector, Sets.newLinkedHashSet());
cField.set(this.goalSelector, Sets.newLinkedHashSet());
cField.set(this.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 0.6D, true));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false, new Class[0]));
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true));
}
Но Когда я пытаюсь в этом же класс в новом методе поставить имя этому мобу вылезает ошибка IDE:
Код:
EntitySilverfishMob.this.setCustomName(ChatColor.RED + "Тюремная крыса " + EntitySilverfishMob.this.getHealth() + "♥");
Ошибка:
No enclosing instance of the type EntitySilverfishMob is accessible in scope
Помогите!