Jump to content

[1.12.2] "Toasts" Documentation [Solved]


ModMCdl

Recommended Posts

I'm having trouble trying to find any info on implementing custom toast messages in 1.12.2 (ie. the advancements/crafting messages in top right corner). I've skimmed through the docs but I can't seem to find any info there. Could someone possibly provide links to documentation/tutorials or source that implements these? Or just point me in the right direction? 

 

Thanks.

Edited by ModMCdl

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

2 hours ago, ModMCdl said:

I'm having trouble trying to find any info on implementing custom toast messages in 1.12.2 (ie. the advancements/crafting messages in top right corner). I've skimmed through the docs but I can't seem to find any info there. Could someone possibly provide links to documentation/tutorials or source that implements these? Or just point me in the right direction? 

 

Thanks.

If you just want to display an achievement-like info box, 1.12.x has now generalized system into so-called toasts. You can implement the IToast interface and display it using MInecraft#getToastGui().add(IToast). This way you do not need this "fake achievement" just to display a box.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

9 hours ago, Animefan8888 said:

If you just want to display an achievement-like info box, 1.12.x has now generalized system into so-called toasts. You can implement the IToast interface and display it using MInecraft#getToastGui().add(IToast). This way you do not need this "fake achievement" just to display a box.

I understand what they are. I didn't say anything about "fake achievements." You didn't even answer my question. I know there's a way to do it, I know there's an interface to use. Where do I call this method?

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

2 minutes ago, ModMCdl said:

Where do I call this method?

On the client when you want the gui to popup... 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

24 minutes ago, ModMCdl said:

I understand what they are. I didn't say anything about "fake achievements." You didn't even answer my question. I know there's a way to do it, I know there's an interface to use. Where do I call this method?

He did answer your question and even gave you the code.

 

Regarding "documentation" in general, you really just need to look at the source code and see how it works for similar vanilla behavior. Some big topics like blockstates have official documentation, and many people like myself try to write tutorials, but honestly we really all just figure it out by reading the source directly.

  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.