Make a link between two events

Discussion in 'Plugin Development' started by 4z3rty, Jun 26, 2012.

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

    4z3rty

    Hi,
    I have two events :
    Code:
    public void tapeCommand(PlayerCommandPreprocessEvent e){ ... }
    public void ouvreCoffre(PlayerInteractEvent e){ ... }
    I would like to execute my code in the second event if the command was typed.
    I have tried to link the two with a variable but once the order has been entered all players can use the second part.

    I hope I was clear ^^
     
  2. Tried doing a separate method that gets passed over all the variables that you need and both events can offer?
     
  3. Offline

    4z3rty

    I'm newbie to java, I start ...
    Can you write a few lines of code?
     
  4. Offline

    caldabeast

    Code:java
    1.  
    2. public void event1(Event e){
    3. run(e.getPlayer);
    4. }
    5. public void event2(Event e){
    6. run(e.getPlayer);
    7. }
    8. public void run(Player p){ //and any other information you can get from both events that you may need
    9. }
    10.  
     
    ferrybig likes this.
  5. Offline

    4z3rty

    I don't understand, can you me explain a little ?
     
Thread Status:
Not open for further replies.

Share This Page