Posted July 18, 20178 yr 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!
July 18, 20178 yr 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.
July 18, 20178 yr Author 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?
July 18, 20178 yr 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.
July 18, 20178 yr Author 1 minute ago, Animefan8888 said: No, I will not write your code for you. Take a look at GuiButton http://prntscr.com/fxc1ff http://prntscr.com/fxc1kf but nothing is showing up
July 18, 20178 yr 2 minutes ago, HuskyHMC said: http://prntscr.com/fxc1ff http://prntscr.com/fxc1kf but nothing is showing up 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.
July 18, 20178 yr Author 41 minutes ago, Animefan8888 said: Your ResourceLocation is pointing to the minecraft domain and not your mods domain aka the modid. It is pointing to the minecraft domain
July 18, 20178 yr 2 minutes ago, HuskyHMC said: It is pointing to the minecraft domain Where is 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.
July 18, 20178 yr 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.
July 18, 20178 yr Author 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
July 18, 20178 yr 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.
July 18, 20178 yr Author 1 minute ago, Animefan8888 said: Show me a screenshot of your package explorer and your code for the button. And where you add the button to the Gui. https://justpaste.it/193cn this is my button code
July 18, 20178 yr 15 minutes ago, Animefan8888 said: And your ResourceLocation needs to be initialized like so new ResourceLocation(modid, "textures/gui...") Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
July 18, 20178 yr 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.
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.