Problem with Hiding Stats Bars

Started by TKG112 on

Topic category: Help with modding (Java Edition)

Last seen on 03:29, 10. Mar 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Problem with Hiding Stats Bars
Tue, 02/13/2024 - 02:34 (edited)

I'm trying to make a mod that hides the hunger bar, I found this post: https://mcreator.net/forum/94756/how-hide-hunger-bar-or-any-other-bar-health-ect-very-simple-1165. That worked, but, only if playing in singleplayer, when I tried to add the mod to my server, it throws this error: https://pastebin.com/h6CEsdu8. What can I do to prevent this? And yes, I'm in 2022.2
 

Edited by TKG112 on Tue, 02/13/2024 - 02:34
Last seen on 02:33, 27. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Couldn't follow the link,…
Mon, 02/12/2024 - 12:21

Couldn't follow the link, but I'm not even sure you need a mod for that. You can use a resource pack that makes the status bars invisible just by erasing and overriding their texture. (You could also do this in a mod- you would add a 'minecraft' folder in your workspace's src/main/resources/assets file, and from there just copy the resource pack file system.) As long as your mod resources are loaded above the vanilla resources, (which they are by default), it would replace the status bar textures with invisible textures. (You can probably find the texture here.)

Last seen on 03:29, 10. Mar 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is the code: import net…
Mon, 02/12/2024 - 23:56

This is the code:

import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@Mod.EventBusSubscriber(modid = "putmodidhere", bus = Mod.EventBusSubscriber.Bus.FORGE) //SET YOUR MOD ID IN PUTMODIDHERE!
public class HideHunger{

    @SubscribeEvent
    public static void hideHungerBar(RenderGameOverlayEvent.Pre event) {
        if (event.getType() == RenderGameOverlayEvent.ElementType.FOOD) { // .FOOD can be anything from the list at top of forum!
            event.setCanceled(true);
        }
    }
}

And the error is basicly this:

Failed to register automatic subscribers. ModID: hidehungerbar, class net.mcreator.hidehungerbar.HidehungerbarMod
java.lang.NoClassDefFoundError: com/mojang/blaze3d/matrix/MatrixStack
Last seen on 02:33, 27. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's likely the code is…
Tue, 02/13/2024 - 01:16

It's likely the code is outdated. I don't think it's a good idea to hide the hunger bar by altering the render code. It really should be as easy as just removing the textures. (Making a resource pack, in which the 'icons' texture has the hunger bar removed.)

Last seen on 03:29, 10. Mar 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, it functions normally…
Tue, 02/13/2024 - 02:29

Yeah, it functions normally in singleplayer as I said, but when added to a server, it gives that error, I just wandered why, but thanks for the response, and to clarify, I'm using the 1.16.5 version of MCreator.