1.12.2 Varible doesn't set in another class

Discussion in 'Spigot Plugin Development' started by pam20, Jul 20, 2021.

Thread Status:
Not open for further replies.
  1. Hi! I have a class and i can check the varible's value in another class, but i can't set the value for varbile.
    First class::
    Code (Text):

    public class Helps {

       private boolean buildModeState = false;
     
       public void setBuildModeState(boolean adat) {
           this.buildModeState = adat;
       }
     
       public boolean getBuildModeState() {
           return this.buildModeState;
       }
    }
     
    Another class:
    new Helps().setBuildModeState(true);

    it stays false all the time
     
  2. SteelPhoenix

    Moderator

    Each instance you create has its own value...
     
  3. Sorry, but how do you mean that?
     
  4. How can i solve this? I can't find solution on the internet.
     
Thread Status:
Not open for further replies.