HyperScript
Docs

← All of the Docs Commands and events

Permissions

structurepermission: valuesince 1.5.1

Who may run the command

command /fly:
    permission: "server.fly"
    trigger:
        execute console command "fly %player.name%"
Try it
expressionopsince 1.5.1

Server operators and the console, whatever permissions plugin is installed

command /shutdown:
    permission: op
    trigger:
        execute console command "stop"
Try it
effectpermission <who> add <node>since 1.5.1

Give the permission. It lasts across relogs and restarts

permission player add "server.fly"
Try it
effectpermission <who> add <node> for <duration>since 1.7.60

Give it for a time: afterwards it is taken back by itself, also if the player was away or the server off meanwhile

command /trialfly:
    trigger:
        permission player add "server.fly" for 1 hour
        send "&aYou can fly for an hour."
Try it
effectpermission <who> remove <node>since 1.5.1

Take back a permission given this way

permission player remove "server.fly"
Try it
condition<who> has permission <node>since 1.5.1

A condition; also does not have permission

if player has permission "tools.unbreaking":
    cancel event
Try it
Guide and examples

A command can be limited to players holding a permission node, or to server operators:

command /fly:
    permission: "server.fly"
    trigger:
        execute console command "fly %player.name%"

command /shutdown:
    permission: op
    trigger:
        execute console command "stop"
permission: valueWho may run the command
a node, such as "server.fly"Players who have that permission. Quotes are optional
opServer operators and the console, whatever permissions plugin is installed
not givenEveryone

Scripts can also hand out permissions themselves:

command /buyfly:
    trigger:
        if {%player%.coins} < 500:
            send "&cFlying costs 500 coins."
            stop
        subtract 500 from {%player%.coins}
        permission player add "server.fly"
        send "&aYou can now use /fly."
StatementEffect
permission <who> add <node>Give the permission. It lasts across relogs and restarts
permission <who> add <node> for <duration>Give it for a time: afterwards it is taken back by itself, also if the player was away or the server off meanwhile
permission <who> remove <node>Take back a permission given this way
<who> has permission <node>A condition; also does not have permission
  • <who> is player, all players, or a player name; the player has to be online.
  • Granted permissions are saved with the player's data and applied again each time they join.
  • remove only undoes what add gave. A permission the player has from a rank or another plugin stays; change that in the plugin that manages your ranks.