Advertisement
DylanoGames

NickNamer Plugin

Apr 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package me.DylanoGames11.nicknamer;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandSender;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.plugin.java.JavaPlugin;
  7.  
  8. /**
  9. * gemaakt door: DylanoGames in 14 april
  10. */
  11. public class Main extends JavaPlugin {
  12. public void onEnable () {
  13. getLogger().info("Plugin is aangezet!");
  14. return;
  15. }
  16.  
  17. @Override
  18. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  19. if (command.getName().equalsIgnoreCase("nick")) {
  20. if (args.length == 0) {
  21. return true;
  22. }
  23. if (args.length > 1) {
  24. return true;
  25. }
  26. Player player = (Player) sender;
  27. player.setDisplayName(args[0]);
  28. player.setPlayerListName(args[0]);
  29. if (args[0].equalsIgnoreCase("reset")) {
  30. player.setDisplayName(player.getName());
  31. player.setPlayerListName(player.getName());
  32. return true;
  33. }
  34. return true;
  35. }
  36. return true;
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement