Villager not updating

Discussion in 'Plugin Development' started by Yeowza, Mar 6, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Yeowza

    Anybody see any problems with this?

    Code:
    v = (Villager) Main.world.spawn(new Location(Main.world, -993, 85, 991), Villager.class);
    v.setProfession(Profession.FLETCHER);
    v.getLocation().setX(v.getLocation().getX() + 0.6);
    v.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 3560000, 356000));
    The potion effect gets set but the profession and location are not being updated. The server shows the profession as Fletcher when I output the value but it is not showing it in the client.
     
  2. Offline

    Zombie_Striker

    @Yeowza
    For the profession issue, what happens if you relog? Does doing that update the villager's skin? Also, what happens if you try to click on the villager? Does it show the fletcher's trading gui?

    As for the location issue, you cant set the location that way. You need to use the v.teleport(....) method.
     
  3. Offline

    Yeowza

    The v.teleport worked Zombie_Striker, thank you. :p

    Nothing happens when I relog or click on him. None of the professions work, its like hes not getting updated in the client for some reason even though the server is showing the right values.
     
  4. Offline

    KarimAKL

  5. Offline

    Yeowza

    Yep, it sounded like he had the same problem and just gave up on it which is probably what I'll do :rolleyes: so many bugs in minecraft
     
  6. Offline

    KarimAKL

    @Yeowza Did you read about the part with the onEnable and no players? Are you doing that as well? If not, i'm not sure what else could be causing it.
     
  7. Offline

    Yeowza

    Yep, I have my test account login to the spot before I spawn it in but doesn't work. Thanks anyway man.
     
Thread Status:
Not open for further replies.

Share This Page