Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Gaming
Minecraft
Minecraft Releases
[CODE] Change username [BUKKIT
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Divide" data-source="post: 215367" data-attributes="member: 35464"><p>Hi,</p><p> </p><p>I created some code to change your username in the server and in-game.</p><p>You can be whoever you want with this and troll your friends!</p><p> </p><p>The command I named it as is "/dme" (Disguise me).</p><p>With this command you can also login to your server more than once because it thinks you've logged out!</p><p> </p><p><u><strong>Here it is</strong></u></p><p>[CODE]if(commandLable.equalsIgnoreCase("dme")){</p><p>if(sender instanceof Player){</p><p>if(!sender.isOp())</p><p>{</p><p>sender.sendMessage("This is an op only command!");</p><p>return true;</p><p>}</p><p> Player player = (Player) sender;</p><p> String nameBefore = player.getName();</p><p> EntityPlayer ep = ((CraftPlayer) player).getHandle();</p><p> if(args[0].equalsIgnoreCase("notch"))</p><p> {</p><p> ep.name = ChatColor.GOLD + "Notch" + ChatColor.RESET;</p><p> player.setDisplayName(ChatColor.GOLD + "Notch" + ChatColor.RESET);</p><p>player.setPlayerListName(ChatColor.GOLD + "Notch" + ChatColor.RESET);</p><p>for(Player p : Bukkit.getOnlinePlayers())</p><p> {</p><p>if(p != player)</p><p>{</p><p> ((CraftPlayer) p).getHandle().playerConnection.sendPacket(new Packet20NamedEntitySpawn(ep));</p><p> Location loc = player.getLocation();</p><p> Bukkit.getWorld("world").setSpawnLocation(loc.getBlockX(), loc.getBlockY() + 1, loc.getBlockZ());</p><p> p.sendMessage(ChatColor.YELLOW + nameBefore + " left the game.");</p><p> p.sendMessage(ChatColor.YELLOW + player.getName() + ChatColor.YELLOW + " joined the game.");</p><p>}</p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="Divide, post: 215367, member: 35464"] Hi, I created some code to change your username in the server and in-game. You can be whoever you want with this and troll your friends! The command I named it as is "/dme" (Disguise me). With this command you can also login to your server more than once because it thinks you've logged out! [U][B]Here it is[/B][/U] [CODE]if(commandLable.equalsIgnoreCase("dme")){ if(sender instanceof Player){ if(!sender.isOp()) { sender.sendMessage("This is an op only command!"); return true; } Player player = (Player) sender; String nameBefore = player.getName(); EntityPlayer ep = ((CraftPlayer) player).getHandle(); if(args[0].equalsIgnoreCase("notch")) { ep.name = ChatColor.GOLD + "Notch" + ChatColor.RESET; player.setDisplayName(ChatColor.GOLD + "Notch" + ChatColor.RESET); player.setPlayerListName(ChatColor.GOLD + "Notch" + ChatColor.RESET); for(Player p : Bukkit.getOnlinePlayers()) { if(p != player) { ((CraftPlayer) p).getHandle().playerConnection.sendPacket(new Packet20NamedEntitySpawn(ep)); Location loc = player.getLocation(); Bukkit.getWorld("world").setSpawnLocation(loc.getBlockX(), loc.getBlockY() + 1, loc.getBlockZ()); p.sendMessage(ChatColor.YELLOW + nameBefore + " left the game."); p.sendMessage(ChatColor.YELLOW + player.getName() + ChatColor.YELLOW + " joined the game."); } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Gaming
Minecraft
Minecraft Releases
[CODE] Change username [BUKKIT
Top