0
\$\begingroup\$

Hello i have been working on a part of my plugin that has waypoints allowing the user to create delete etc. I got to thinking after using and seeing a couple of the disguse plugins. That maybe i could create a command toggle that would show the user where the waypoints they have are! I know how to do all of this i just have no idea how to display a nameplate to the client. I know its possible because disguisecraft does it i tried looking though their code but couldent find much...

I belive to get this effect i need to send packets to the client if someone can direct me to a list of bukkit packets or even a solution to sending the client a custom located nameplate that would be fantastic! Thanks in advanced.

\$\endgroup\$
1
\$\begingroup\$

I'm not exactly sure what you mean about a custom nameplate, but DisguiseCraft (which I'm a developer of) uses Bukkit's display name function. We merely used player.setDisplayerName("NewName") so that players appeared to have the new names and could talk in the chat with them.

\$\endgroup\$
1
  • \$\begingroup\$ Oh that makes sense thank you... Anyways i was looking for something similar to this that i could tell where it is placed like a x y z coord \$\endgroup\$
    – HcgRandon
    Apr 17 '12 at 11:59
0
\$\begingroup\$

Yes, DisguiseCraft uses packets to change the name of a player or remove the name tag. The 'player.setDisplayName' function only changes the name that will appear in chat, not the nameplate above the player entity. I'm not entirely sure what the code would look like, but from what I understand you want actual floating name tags with the name of the waypoint. My idea would be to spawn named entities, making them invisible somehow, and making them not move from the waypoint location. You could also change the color of the nameplate to make it easier for players to distinguish from a normal player name tag and a waypoint.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ That doesn't answer the question though. \$\endgroup\$
    – Anko
    Dec 9 '12 at 1:08
0
\$\begingroup\$

It's technically not possible to hide the nameplates without hiding the person, changing nameplates requires skin changes as it sends packets to fool the client into believing another player is where the real player is. UNLESS you hook into something like the spoutcraft API or another client-side mod.

\$\endgroup\$
-1
\$\begingroup\$

Alright first of all:

player.setDisplayerName("NewName")

Where would you put it at in the first place, it's not going to be:

public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
Player player = (Player) sender;

Maybe:

}if(args.length == 0){
    player.setDisplayerName(ChatColor.BLUE + player.getName());

And basically keep doing the args until it's enough:

 args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11] + " " + args[12] + " " + args[13] + " " + args[14] + " " + args[15]); 
\$\endgroup\$
1
  • \$\begingroup\$ i don't really understand what you are saying here? \$\endgroup\$
    – HcgRandon
    May 15 '12 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.