Execute Task Later

Discussion in 'Plugin Development' started by DeathVader1337, May 13, 2013.

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

    DeathVader1337

    Hello!

    I'd like to allow a user to create "temporary permissions" where they can add a permission to a player for a set amount of times. I know I can do this using ticks, but my concern is performance. Will the plugin lag a server?

    Also, how would I go about doing this?

    Thanks for your help.
     
  2. Offline

    sirrus86

    Adding temporary permissions to a player is fairly simple:

    Code:
    player.addAttachment(Plugin plugin, String node, boolean value, int ticks);
    From my understanding this isn't too taxing on the server.
     
  3. Offline

    DeathVader1337

    sirrus86

    Hi, I don't see that method in the Bukkit Docs. Could you point it out? Thanks.
     
  4. Offline

    sirrus86

  5. Offline

    DeathVader1337

    sirrus86

    Do you mind giving me an example of how this method would be used?
     
  6. Offline

    sirrus86

    Sure, assuming "plugin" is a direct reference to your plugin's main class and you wish to set the node "plugin.node" to true for 10 seconds:
    Code:
    player.addAttachment(plugin, "plugin.node", true, 200);
    How you get player depends on what method you intend to you (event listener, command, etc).
     
Thread Status:
Not open for further replies.

Share This Page