Wolf spawn in ground?

Discussion in 'Plugin Development' started by kameronn, Oct 13, 2016.

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

    kameronn

    Well, I'm spawning multiple wolves at a player's location and for some reason they spawn in the ground. I've also tried spawning them a block above the ground and that didnt help either.

    Code:
            void spawnWolves(Wolf e, Player player) {
                e.setOwner(player);
                e.setTamed(false);
                e.setMaxHealth(6);
                e.setHealth(6);
                e.setVelocity(new Vector());
                e.setCanPickupItems(false);
               
                List<Entity> near = player.getNearbyEntities(15.0D, 15.0D, 15.0D);
                for(Entity entity : near) {
                    if(entity instanceof Player) {
                        Player c = (Player) entity;
                         e.setTarget(c);
                         e.damage(0, c);
                        
                    }
                }
            }
     
  2. Offline

    Zombie_Striker

    @kameronn
    Since you don't specify their location here, this does not help us. Please post the bit of code where you spawn them or teleport them.
     
  3. Offline

    kameronn

    @Zombie_Striker
    Code:
    for(int i=0;i < 14;i++) {
                            Wolf e = (Wolf)player.getWorld().spawnCreature(loc, CreatureType.WOLF);
                             wolvesSpawn(e,player);
    Loc is the player's location
     
  4. Offline

    Zombie_Striker

    @kameronn
    Instead of teleporting the wolf, have you tried adding 1 to the loc's y using the .add() method? Have you tried using a different location?
     
Thread Status:
Not open for further replies.

Share This Page