Solved OnPlaceEvent & InventoryClickEvent Variables

Discussion in 'Plugin Development' started by Tencu, Feb 3, 2018.

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

    Tencu

    Hello there, i'm trying to make soem variables from my OnPlaceEvent go to InventoryClickEvent. But i'm not entirely sure how. I get my player variable in inventoryclickevent from my event. But i dont know how to transfer the variables from my OnPlaceEvent, specificly x, y and block.

    https://hastebin.com/efobeyojit.java

    Any help is appreciated
     
  2. Offline

    Machine Maker

    If you want variables to be used in multiple functions in one class, you have to initialize the variable outside the function. Try initializing the variable outside of any functions; you'll have access to it in both then.
     
  3. Offline

    CeramicTitan

    I'm surprised at the complexity of your code considering you don't know how to use global variables....
     
    Zombie_Striker likes this.
  4. Offline

    Zombie_Striker

    @Tencu
    Also, you forgot to add an @EventHandler to the InvClick event, so the event will not be called. You need that tag in order for bukkit to see the event.
     
  5. Offline

    Tencu

    Last edited: Feb 4, 2018
Thread Status:
Not open for further replies.

Share This Page