Discussion in 'Plugin Development' started by retsrif, Feb 26, 2011.
That's all I want to know. Documentation doesn't help. Thanks
IIRC getName returns the name used for everything internal, it's the player's D if you want (it is not, but look at it this way). Display name is used for chat.
So, as long as I don't do anything related to chat, and only use getName(); from events and use that consistently through the plugin, I should be safe right?
I think so, I never used it for anything like it and my first thought would be if I could use entityID for that, but I think name is used via hasmaps or something.
I use getName() and store that as a string in an ArrayList, and then after another event, I use getName(); again and store it to a temporary string and see if the two strings match... Or is there a better way ?
I don't really know, but I hate to use strings for identification, so I'd suggest trying to use entityID. Just store it on join at it could work? Maybe it gets changed on respawn, but then just store the name also and only test the string on respawn to set the entityID to a new value. But this way you'll be using IDs which is just a short number and not a long string, this more speed
Can I get the ID of a person who right clicks on a block? Left clicks?
everywhere where you can get to player you should be able to get his entityID...
Haha! Though, in onBlockInteract, I can't get to the player?
I think I am getting more idiotic by the second. -.- Thanks
I wrote a personal plugin to support local nicknames. I set the nickname with setDisplayName(). It seems that chat messages use getDisplayName() as expected. However, I just installed HeroicDeath and it appears to use getName() -- hence the nickname is not shown in death messages.
Since I am fairly new to the Bukkit API, I may be abusing setDisplayName for this purpose. Or am I?
Separate names with a comma.