[Solved] Simple Question...

Discussion in 'Plugin Development' started by krazytraynz, Sep 20, 2012.

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

    krazytraynz

    I feel stupid for asking this, but how would I check for a permission that doesn't involve a command? I'm trying to format my onPlayerJoin event so that the message varies depending on the permission the player has.
     
  2. Offline

    zippy120

    try
    Code:
    player.hasPermission("String permission");
     
  3. Offline

    krazytraynz

    zippy120
    Do I need to define the permission somehow?
     
  4. Offline

    Tirelessly

    for example.

    public void onJoin(PlayerJoinEvent e){
    if(e.getPlayer().hasPermission("server.mod"))
    e.getPlayer().sendMessage("You are a mod.")
    }
     
  5. Offline

    Jnorr44

    Permissions are defined in plugin.yml... servers give the permissions to their members, and your plugin uses them...
     
  6. Offline

    krazytraynz

    But don't they normally need to be associated with commands? I want to have a permission that stands on it's own.
     
  7. Offline

    Jnorr44

    it doesn't have to be associated with a command... have you seen the plugin.yml tutorial on the wiki?
     
  8. Offline

    krazytraynz

    Nope, but I have now... Thanks for the help everyone!
     
Thread Status:
Not open for further replies.

Share This Page