Code Help (README)

Discussion in 'Plugin Development' started by cpi2001, Feb 12, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    cpi2001

    Hi! I want to keep this short and simple! I need the code to get the version a my mini games plugin.
    When the sender types /arversion, i want it to log in the chat/console "(PLUGIN NAME) v1.0"!
    Please help by pasting the code in the comments. any help would be greatly appreciated :)

    I am a new dev, so pls help :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  2. Offline

    TeeePeee

    Assuming you already know how to use commands (which I'm assuming you do, seeing as your early project is a mini-games plugin), just take a look at the PluginDescriptionFile docs which has version and more. This retrieves information from the plugin.yml file, including the version if you have it listed in the file.
     
  3. Offline

    ItsLeandro

    Well, if you don't know how the PluginDescriptionFile works, just send the player a message.
    Code:
    if (cmd.getName().equalsIgnoreCase("arversion"){
    Player player = (Player) sender;
    player.sendMessage(ChatColor.RED + "Put your message here");
    }
     
Thread Status:
Not open for further replies.

Share This Page