How can I code Messages with Permissions?

Discussion in 'Plugin Development' started by Begamus, May 31, 2020.

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

    Begamus

    How can I send a message to everyone with a permission in a pluign? For exampdle for a Team-Chat (Everyone who has the permission gets the message, everyone without the permission deosn't get it.)
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Begamus Loop over the players, check the permission, send the message.
     
    Begamus likes this.
  3. Offline

    dioz

    Here's an example:

    Code:
    Bukkit.broadcast("This is an example", "plugin.example");
    This will send a message with the text "This is an example" to all players online that have the permission "plugin.example"
     
    TheEnderCrafter9 and Begamus like this.
Thread Status:
Not open for further replies.

Share This Page