Spawn Animal Names

Discussion in 'Plugin Development' started by JPG2000, Jun 13, 2013.

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

    JPG2000

    Hey! I am having trouble making an Animal have a custom name (Like when your naming a animal from a anvil). I have NO clue how to do this! Please help! This is what I have so far to spawn an animal!

    Location location = player.getLocation();
    player.getWorld().spawnCreature(location, EntityType.PIG);
     
  2. Next time use google first ("Bukkit set entity name")...
    Code:java
    1. Pig pig = (Pig) player.getWorld().spawnEntity(location, EntityType.PIG);
    2.  
    3. pig.setCustomName("OinkOink");
    4.  
    5. // If you want to see it from far away
    6. pig.setCustomNameVisible(true);
     
  3. Offline

    JPG2000

    Hellsing Im confuzed! How would I use that code with a Sheep! Like back to back.
     
  4. Just wrote that answer in the other thread of yours...
     
Thread Status:
Not open for further replies.

Share This Page