Temporarily pausing plugin until X is true

Discussion in 'Plugin Development' started by southernzax, Jun 11, 2014.

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


    I am creating a system where you are pulled into an interface, you click which variable you want to edit so say "Name" and you click the Wool block the inventory closes, lets you edit the variable and then reopens for editing the rest of the variables.

    The problem is that whenever I run the command and the interface opens, it executes all code past the inventory opening as well which includes the parts of the code checking for those variables, which since the user barely had half a milisecond to do anything before it all executed, they were never set and it errors out.

    How can I make it so when the inventory is open, the rest of the code doesn't run until they have finished filling out the strings?

    I was looking into the bukkit scheduler but I wasn't sure if that was proper for the task, bit confused insight would be great, thank you!
  2. Offline


    Put that code inside an event handler instead, which executes for example when the player clicks a specific item in the inventory, or when the player closes the inventory again, or when the player chats (when the player edits the 'Name').
  3. Offline


    schedule a new repeating task, which checks if the condition is true, and if so continues with the code.
Thread Status:
Not open for further replies.

Share This Page