Jump to content

Recommended Posts

Posted

Hello, I was wondering how would I go about changing panorama in main menu. I know that there's no reason to mess with the main menu but this seems like a good example to learn how to change other data types than basic Java data types. I tried using

ObfuscationReflectionHelper#setPrivateValue

but it didn't work because "titlePanoramaPaths" (which I wanted to change to my own image) is "ResourceLocation[]". How can I do this?

 

Posted (edited)
6 minutes ago, imacatlolol said:

It wants an array of ResourceLocations, so just give it that. If you don't know what a ResourceLocation is, read the docs.

I know, I came up with this:

ResourceLocation[] background = new ResourceLocation[]{new ResourceLocation("mod/splash.png")};
ObfuscationReflectionHelper.setPrivateValue(GuiMainMenu.class, (GuiMainMenu) e.gui, background, "titlePanoramaPaths");

e is InitGuiEvent

"mod/splash.png" is in "assets/minecraft/mod/splash.png"

Edited by Vert3xo
Posted

GuiMainMenu is not a thing in modern Minecraft, and the version you're using is no longer supported. You need to update to 1.14/1.15.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Posted
3 minutes ago, imacatlolol said:

GuiMainMenu is not a thing in modern Minecraft, and the version you're using is no longer supported. You need to update to 1.14/1.15.

Do you have any example code for 1.15? Maybe I'll be able to then apply it to older versions myself.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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