need help with invisible

Discussion in 'Plugin Development' started by goodstuff20, Mar 13, 2013.

Thread Status:
Not open for further replies.
  1. Hi guys,
    i wanted to make a plugin that makes specific players invisible - i started up simple but it doesent work
    All help apreciated!
    Heres the code:
    Code:
    public class noname extends JavaPlugin implements Listener{
     
     
    @Override
    public void onEnable(){
    PluginManager pm = this.getServer().getPluginManager();
     
    }
    @Override
    public void onDisable(){
     
    }
     
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
    if(cmd.getName().equalsIgnoreCase("nn")) {
    if(!(sender instanceof Player)) {
    sender.sendMessage("Ya have ta be a Playa!");
    }
    else {
    Player player = (Player)sender;
    if(player.getName() == "Tomy_567") {
    player.setDisplayName(null);
    player.setPlayerListName(null);
    player.showPlayer(null);
    return true;
    }
    }
    return true;
    }
     
    return true;
    }
     
    public void onPlayerJoin(PlayerJoinEvent event) {
     
    }
     
    }
    
     
  2. Offline

    stuntguy3000

    What part doesn't work -.-
     
  3. well i dont get error but it just says this command does not exist

    heres my plugin.yml:
    Code:
    name: noname
    main: com.gmail.gustllund
    version: 0.3
    author: Gustllund
    commands:
       nn:
          description: this this.
          usage: /<command>
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  4. You need to read the javadocs about how showing and hiding a player works:

    Here:
    http://wiki.bukkit.org/Plugin_Tutorial#Hiding_player_from_other_players

    Edit:
    1) Your java file should start with a uppercase letter.
    2) Your plugins main java file should be in a package and that package should be in the plugin.yml E.g. com.gmail.gustllund.Noname should be in the plugin.yml if the java file is called Noname
     
  5. oh thx i totally forgat to put in the plugin.yml main: ... .noname
    thx (if feel so stupid right now) :)
     
Thread Status:
Not open for further replies.

Share This Page