Jump to content

Change Minecraft buttons with images.


HuskyHMC

Recommended Posts

3 minutes ago, HuskyHMC said:

Hello there everyone. I have a problem with coding my mod. I wanna can change minecraft buttons ( http://prntscr.com/fxbqzg ) with a image ( like : http://prntscr.com/fxbrcc ). So when I will press the image I should be send in the SinglePlayerGUI. How Can I do that? How I can add image and to do that action? 

 

Thank you in advance!

If I got this right you are asking how you can change what the button looks like. Make a class that extends GuiButton and override GuiButton#drawButton to instead use your image.

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

8 minutes ago, Animefan8888 said:

If I got this right you are asking how you can change what the button looks like. Make a class that extends GuiButton and override GuiButton#drawButton to instead use your image.

Can you create the GuiButton#drawButton for me? How should be that if i want to add that image? 

Link to comment
Share on other sites

Just now, HuskyHMC said:

Can you create the GuiButton#drawButton for me?

No, I will not write your code for you.

Just now, HuskyHMC said:

How should be that if i want to add that image?

Take a look at GuiButton

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

2 minutes ago, HuskyHMC said:

Your ResourceLocation is pointing to the minecraft domain and not your mods domain aka the modid.

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

Just now, HuskyHMC said:

assets/textures/gui

There is no domain there. It needs to be assets/modid(your mods id)/textures/gui. And your ResourceLocation needs to be initialized like so new ResourceLocation(modid, "textures/gui...")

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

10 minutes ago, Animefan8888 said:

There is no domain there. It needs to be assets/modid(your mods id)/textures/gui. And your ResourceLocation needs to be initialized like so new ResourceLocation(modid, "textures/gui...")

still not working

Link to comment
Share on other sites

Just now, HuskyHMC said:

still not working

Show me a screenshot of your package explorer and your code for the button. And where you add the button to the Gui.

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

3 minutes ago, HuskyHMC said:

https://justpaste.it/193cn this is my button code

You did not really do anything i said...

1 hour ago, Animefan8888 said:

Make a class that extends GuiButton and override GuiButton#drawButton to instead use your image.

And

17 minutes ago, Animefan8888 said:

There is no domain there. It needs to be assets/modid(your mods id)/textures/gui. And your ResourceLocation needs to be initialized like so new ResourceLocation(modid, "textures/gui...")

 

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

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.