Where a Villager is Looking

Discussion in 'Plugin Development' started by Creeperzombi3, Nov 11, 2015.

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

    Creeperzombi3

    So I was trying to spawn a Villager that looks in the same place that the player is when they type a command.
    This is what I've tried.
    Code:java
    1. Entity t = p.getWorld().spawnEntity(p.getLocation(), EntityType.VILLAGER);
    2. t.getLocation().setYaw(p.getLocation().getYaw());
    3. t.getLocation().setPitch(p.getLocation().getPitch());
    4. t.getLocation().setDirection(p.getLocation().getDirection());
    5. t.setVelocity(p.getVelocity()); //Pretty sure this does nothing
     
    Last edited: Nov 11, 2015
  2. Offline

    teej107

    @Creeperzombi3 Getting the location returns a copy of their current location. You need to set the location.
     
Thread Status:
Not open for further replies.

Share This Page