Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How to add a gui that opens when you press a button


Skarte
 Share

Recommended Posts

11 minutes ago, diesieben07 said:

It would really help if you answered all of my questions and not just one of them.

oh sorry but what is tickevent#phase 

and do you accept ?

20 minutes ago, Skarte said:

also if my code didn't work out is it possible to take my code and make it work out and give it to me but i think that would be asking for too much

 

Link to comment
Share on other sites

1 minute ago, Skarte said:

oh sorry but what is tickevent#phase 

It's a field. Every tick event fires twice per tick, once before the vanilla logic and once after. If you do not check for the value of TickEvent#phase in your event handler your code will run in both of these cases, which is not what you want.

 

1 minute ago, Skarte said:

and do you accept ?

No.

Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

It's a field. Every tick event fires twice per tick, once before the vanilla logic and once after. If you do not check for the value of TickEvent#phase in your event handler your code will run in both of these cases, which is not what you want.

 

No.

how do i stop it?

 

Link to comment
Share on other sites

You seriously need to learn to use your IDE.

Let's go through this together.

 

TickEvent#phase looks like this:

public final Phase phase;

 

Okay, so, what is phase? Let's navigate to it:

public enum Phase {
    START, END;
}

 

This lines up with what I have explained: The event fires once before the vanilla logic (START) and once after (END).

Now you simply need to check which one of these it is. If that is too complex for you, then I'm afraid you need to go back and learn basic Java before continuing your Mod.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.