Can't see custom name.

Discussion in 'Plugin Development' started by 1928i, Aug 30, 2014.

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

    1928i

    How do I make it so you can't see the custom name of a mob. I thought it could be .setCustomNameVisible(false) but it didn't work. Can anyone help?
     
  2. Offline

    xize

    1928i

    you can't do this (maybe on it slightest with packets/nms), since clients automatic render it.
    edit if you mean in the direction of setCustomNameVisible(false); and then for compairing with getCustomName();

    however why do you want to hide the name?, if you want to put some data in the entity you may want to use:

    Code:
    setMetadata("yourname", new FixedMetadataValue(plugin, "something nonsense"));
    
    and then just do in other events:

    Code:
    if(entity.hasMetadata("yourname")) {
          //we got him
    }
    
    however keep in mind when you restart the server or reload it this metadata is probably gone.

    edited the post a bit:p
     
  3. Offline

    1928i

    xize What would go under the "yourname" and "something nonsense"
     
  4. Offline

    xize

    1928i

    it actually works as a sort of HashMap so yourname will be the key and "something nonsense" just as something nonsense since I think you only want to use the keys to verify whenever entity should be a bit different:p

    I myself didn't found a other solution yet to ignore the value:p
     
  5. 1928i what you could do it make then spawn at a Location of your choice. then do this for instance.

    Code:java
    1. Mob m = (Mob) loc.getWorld().spawnEntity(loc1,
    2. EntityType.YOUR_MOB);


    They try set it's custom name.
     
Thread Status:
Not open for further replies.

Share This Page