Is there any way to set specific data (like display name) in entity Ender Crystal?

Discussion in 'Spigot Plugin Development' started by Msql, May 20, 2016.

  1. Is there any way to set specific data (like display name) in entity Ender Crystal?
    I am creating new faction plugin that will basic on faction's core that must be destroyed.
    I need to make any other ender crystal belong to specific faction.
    I want to basic on data of this entity like setting display name to tag of faction to specify if this endercrystal belongs to faction that player is in.

    Thanks for any help and sorry for my english - it is not my main language.
     
    • Creative Creative x 1
  2. .setCustomName?
     
    • Agree Agree x 1
  3. I have tried it but when I try to get name of entity it says null ;/
     
  4. Oh, I'm currently on my phone but once I'm on my computer I'll look into it
     
    • Like Like x 1
  5. @piter909 are you sure the name is null? Mind showing the code when you set it and when you get it?
     
  6. Yes. After name set I used to get this entity's name and it was null or default name like "EnderCrystal". It was some time ago, this is why I am not sure. I really do not want to loop entities around or check victim on damage event and look into variables for faction that owns specific chunk where ender crystal is, because it is more complicated for CPU and not smart ;/
     
  7. #setCustomName() and #getCustomName() should work.
     
  8. @NinjaStix read the comments before posting answer duplicates .-.

    @piter909
     
  9. I did... I wasn't posting duplicates, I was simply reinforcing the fact that those methods should do what he wanted. I was supporting you, actually...

    EDIT: Also you never mention #getCustomName()
     
  10. CustomName methods does not work with Ender Crystal for me :/
     
  11. Any ideals how to write any data into livingentity ender crystal that will help me to specify who is owner of specific ender crystal?
    I need it a lot ;//
     
  12. Ty for reading my comment
     
  13. Any ideals..?
     
  14. @piter909
    User user = Forum.byURL("spigotmc.org").getUser("piter909");
    while (user.wontRead())
     
    #14 megamichiel, May 20, 2016
    Last edited: May 20, 2016
    • Agree Agree x 1
  15. You could write a Class for a Custom EnderCrystal containing the Crystal ingame with custom settings/properities.
     
  16. @megamichiel has already asserted a perfectly viable idea. Now you need to provide your source code so someone can help you fix it.
     
    • Agree Agree x 1