How to spawn in an edited entity?

Discussion in 'Plugin Development' started by Tythus, Sep 1, 2014.

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

    Tythus

    So for example I want to spawn in a horse called bob how would I edit his name so that he spawns in being called bob?
     
  2. Offline

    mine-care

    Code:java
    1. Entity e = world.spawnEntity(...); // make sure this entity is living entity!
    2. LivingEntity len = (LivingEntity) e; //casting entity e to living entity
    3. len.setCustomName(ChatColor.red+"Name!");//set the name to something
    4. len.setCustomNameVisible(true);// set the name to display
    5.  

    hope i helped

    Other than tha if you want the entity frozen or have a custom behaviour you need NMS :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
Thread Status:
Not open for further replies.

Share This Page