Mob Spawning Location

Discussion in 'Plugin Development' started by CactusComboPvP, Feb 16, 2015.

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

    CactusComboPvP

    I am using this code:

    Code:
        World world = Bukkit.getWorld("world");
                CustomEntityZombie vil = new CustomEntityZombie(
                        ((CraftWorld) world).getHandle());
                Location playerLoc = getUser().getPlayer().getLocation();
                double x = playerLoc.getX();
                double y = playerLoc.getY();
                double z = playerLoc.getZ();
                float p = playerLoc.getPitch();
                float yaw = playerLoc.getYaw();
                vil.setLocation(x, y, z, yaw, p);
                ((CraftWorld) world).getHandle().addEntity(vil);
    [​IMG]

    But it looks to the left whilst it should to the front, where I was facing?
    Any fix?
     
  2. Offline

    Zombie_Striker

    Have you tried ...
    Code:
    Entity.getLocation().setDirection(P.getLocation().getDirection());
    if they player is standing still, it should just look in that direction.

    BTW. How are you making sure it doesn't move or look in another direction?
     
    CactusComboPvP likes this.
  3. Offline

    CactusComboPvP

    @Zombie_Striker

    I am standing still but it still looks to the left of me, and i'm using NMS code.

    Also, your code crashes my minecraft client

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  4. @CactusComboPvP Please dont bump your post after 1 hour. Please only bump after 24hrs.
     
Thread Status:
Not open for further replies.

Share This Page