Jump to content

Search the Community

Showing results for tags 'guis'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Minecraft Forge
    • Releases
    • Support & Bug Reports
    • Suggestions
    • General Discussion
  • Mod Developer Central
    • Modder Support
    • User Submitted Tutorials
  • Non-Forge
    • Site News (non-forge)
    • Minecraft General
    • Off-topic
  • Forge Mods
    • Mods

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


XMPP/GTalk


Gender


URL


Location


ICQ


AIM


Yahoo IM


MSN Messenger


Personal Text

Found 16 results

  1. I created a custom effect called "Fullness" that prevents the player from losing hunger when they get the effect. For this, I created a new java class called FullnessEffect. Everything is working fine, and the player isn't able to lose hunger, but I wanted to make it so that whenever you have the Fullness effect, your hunger bar changes color to gold, similar to how your hunger bar turns sickly green when you have the hunger effect. I searched online, but there seems to be no information regarding how to do this. Does anyone know how to do this? Here is the code for the FullnessEffect class in case anyone needs it (the import section is omitted): public class FullnessEffect extends MobEffect { public FullnessEffect (MobEffectCategory mobEffectCategory, int color) { super(mobEffectCategory, color); } @Override public boolean applyEffectTick (LivingEntity pLivingEntity, int pAmplifier) { if (!pLivingEntity.getCommandSenderWorld().isClientSide() && pLivingEntity instanceof Player player) { FoodData foodData = player.getFoodData(); float exhaustionLevel = foodData.getExhaustionLevel(); if (exhaustionLevel > 0.0F) { player.causeFoodExhaustion(-exhaustionLevel); } } super.applyEffectTick(pLivingEntity, pAmplifier); return true; } @Override public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } } I may sound a bit stupid because I'm a bit new to modding but any help would be greatly appreciated
  2. Hi everyone, I'm working on a mod where I need to display a custom GUI on top of the inventory screen that includes a slider. The goal is to allow the player to select a number using the slider, and then confirm the action, which will split an item stack (similar to shift-clicking, but with a custom number). I've successfully created custom GUIs before using Screen, but I’m running into a couple of issues when trying to integrate a slider into the inventory screen (AbstractContainerScreen): I found the slider in the forge package (net.minecraftforge.client.gui.widget.Slider), but I couldn’t find any usages or examples on how to properly implement it or use it in this context. My Questions: How can I properly integrate a slider into the custom gui screen ? Is net.minecraftforge.client.gui.widget.Slider the right class to use for this? If yes, are there any examples or recommended usages of this Forge slider widget? If not, what would be a good alternative to create a custom slider (maybe extending AbstractSlider or another class)? How do I ensure proper interaction between the slider and the rest of the inventory screen? Any advice, code snippets, or examples would be greatly appreciated! Thanks in advance for your help!
  3. I'm making a city construction mod now and had stumbled upon how to get which block the player's pointing with the cursor. Please help me.
  4. Hey there everyone, I'm building a Minecraft mod inspired by the Fallout series using Forge. My goal is to create an immersive Fallout 76-like experience, including a completely overhauled inventory system centered around a Pip-Boy. Core features: Custom Pip-Boy Interface: Replacing the default Minecraft inventory with a visually appealing Pip-Boy GUI, styled after the Fallout series. Pip-Boy Activation: Accessing the inventory only when a specific Pip-Boy item is equipped. Tab-based Organization: Implementing tabs and subtabs (STATS, ITEMS, DATA, RADIO) for efficient item management. Weight-Based Inventory: Using a weight system instead of limited slots for a more realistic inventory experience. 3D Pip-Boy Model: Rendering a 3D Pip-Boy model within the custom inventory GUI for enhanced immersion. My current Challenges: Resource Scarcity: Difficulty finding up-to-date and comprehensive Minecraft modding tutorials that align with my project's scope. Inventory Overhaul: Replacing the default inventory system with a custom Pip-Boy interface while maintaining core functionality. GUI Development: Creating a visually appealing and functional Pip-Boy GUI, including the integration of a 3D model. Weight System Implementation: Balancing item weights and player carrying capacity for a realistic and engaging experience. I'm seeking guidance on: Efficient GUI creation techniques and best practices. Methods for overriding the default inventory system. Strategies for implementing a weight-based inventory system. Tips for integrating a 3D model into a 2D GUI. I'm open to suggestions for libraries or frameworks that could streamline the development process. While I have experience with programming languages like PHP and C#, I'm relatively new to Java, so clear explanations would be greatly appreciated. Any advice, code snippets, or recommendations would be invaluable. Thank you for your time and expertise!
  5. Hi, I am trying to get custom GUIs working, and I would like to have a GUI that works only client-side, which means that you are not supposed to pull items out, but I do want to display items in my GUI and let the player click them. I have a GUI working that has a size of 54 slots and I made a custom texture to remove the player inventory from the GUI texture (see image) Everything kinda works, but is seems like the inventory is in some way still linked to the player's inventory, even though I didn't add any slots linked to the player's inventory. As an example: If is click in the 5th row of my GUI, I get the chest that was in my hot bar slot (see image). It seems like the handling of the clicking of the inventory is handled by the player inventory still. I also get an error if I click in the bottom row because "java.lang.IndexOutOfBoundsException: Index: 49, Size: 45" the player inventory has a size of 45 I guess? I have posted all my relevant code below, if more is needed to solve this issue please tell me, thanks! Image of weird behaviour: FlipsMenu.java: Opens the menu by changing a "screen to open" variable that gets checked every tick. AHFlipsGui.java: draws the background image and specifies size of the gui. AHFlipsContainer.java: Where we assign the slots. AHFlipsInventory.java: The actual inventory.
  6. private static final ResourceLocation image = new ResourceLocation(Main.MODID, "textures/gui/image.png"); @SubscribeEvent public static void onRenderGuiOverlayPre(RenderGuiOverlayEvent event) { event.getGuiGraphics().blit(image, 0, 0, 0, 0, 64, 64, 64, 64); } I tried to draw an image on the HUD screen with this code. Actually I am drawing the image, but the image is drawn opaque even though it is transparent. How can I solve this problem?
  7. public class HUD { public Minecraft mc = Minecraft.getMinecraft(); public static class ModuleComparator implements Comparator<Module>{ @Override public int compare(Module o1, Module o2) { if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) > Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return -1; } if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) < Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return 1; } return 0; } } public void draw(){ ScaledResolution sr = new ScaledResolution(mc); FontRenderer fr = mc.fontRendererObj; Collections.sort(Client.modules, new ModuleComparator()); GlStateManager.pushMatrix(); GlStateManager.translate(4,4,0); GlStateManager.scale(1.5,1.5,1); GlStateManager.translate(-4, -4, 0); fr.drawString("Skyline", 10, 10, -1); GlStateManager.popMatrix(); int count = 0; for (Module m : Client.modules){ if (!m.toggled || m.name.equals("TabGUI")) continue; int offset = count* (fr.FONT_HEIGHT + 6); GL11.glTranslated(0.0f, 0.0f, -1.0f); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 10, offset, sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, 6 + fr.FONT_HEIGHT + offset, -1); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, offset, sr.getScaledWidth(), 6 + fr.FONT_HEIGHT + offset, 0x90000000); fr.drawString(m.name, sr.getScaledWidth() - fr.getStringWidth(m.name) - 4, offset + 4, -1); count++; } Client.onEvent(new EventRenderGUI()); } } I have just recently stumbled upon this Problem, where the HudRenderer renders the wrong section of the textures and therefore completely destroys the Minecraft Armour and Hunger Bar. I am currently thinking if it is an issue with the DrawRect changing something it shouldn't. But I couldn't find anything about it. (To keep things Clean, the function is Called from another file) public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Post event){ Client.hud.draw(); } } Any help would be greatly appreciated
  8. Hi, I'm making a necklace that stores relics with Curios mod integration. Right-clicking on a diamond currently opens the GUI, but I don't know how to store the items within it. Can anyone help me with this? (minecraft 1.20.1) -> My mod Gith https://github.com/Susakushii/SusakushiMods
  9. Hello forum members! I am relatively new to Forge and I'm having issues with implementing my custom gui elements. Essentially what I'm trying to do is to add a singular rectangle shape which sits on top of every other gui element that's rendered to the player's screen in the Screen object (i.e. when the player is in their inventory or accessing some other inventory like a tile entity and so on...), so essentially i need this rectangles z-index to be the highest out of every other gui element. Later on I plan on adding functionality to this rectangle; the rectangle will serve as the background element. The way I undertand how the GuiGraphics class works is that when you have a SubscribeEvent method which handles rendering of the gui it gets the GuiGraphics object from the event that gets created when the method triggers and then modifys that gui elements of that event. But the issue then is that if I'm targeting the RenderGuiOverlayEvent.Post event and try to add the rectangle with the fill method what ends up happening is that the rectangle gets rendered behind the Screen object. Essentially my question is: Is there an event that gets fired when the absolute last gui element gets rendered and if not is there a WorldLastEvent in terms of gui that gets fired and how does the gui rendering pipeline work in minecraft 1.20, what is the order in which different gui elements get fired? Any help or feedback would be grately appreciated!
  10. Is there a way to disable a HUD element without canceling RenderGuiOverlayEvent.Pre? For Example, in 1.16.5 you could just set a boolean in ForgeIngameGui to false for a specific element: ForgeIngameGui.renderCrosshairs = false;
  11. Good dais this is it i wanna update the briefcase from mi mod this class "NetworkHooks" is resposible for open the screen this class don't exist anymore in 1.20.4 or it is in another place and/or whit another name i check kapenjou tutorials an hes using this same class same place but hes using 1.20.1 so something change from 1.20.1 to 1.20.4 or mi setup is missing something ----------------------------------------------------------------------------------------- thanks for your reading ¿ i need to find if the class was dropped now what replace it ¿ or if it change of location where it is know ¿ or confirm mi setup is lacking or wrong i have intellij 2023.1.1 comunity whit forge-1.20.4-49.0.26-mdk
  12. Is it possible to have a BlockEntity that processes multiple recipes (of the same type) simultaneously? The only way I have thought of so far is to have a BlockEntity that has multiple ItemStackHandlers, but this is apparently not recommended.
  13. So I'm building a forge modpack for myself and some friends on 1.19.2, and since the premise is mainly nostalgia-based I decided to add the newest MCA (Minecraft Comes Alive) port. And it's stellar, besides one GUI it adds with the "interact" option. It just feels very bare-bones and incredibly different from the rest of the NPC menus, and to me at least is a very unwelcome change from the original mod. So long story short, I'm looking for where to add my own custom textures in the files and can't seem to find it. I find the GUI files but they're all json, so I'm guessing it's just the code for it and I don't want to mess that up. Otherwise the textures I can edit seem unrelated. I'm a relative newbie to resource packs and textures-- I mainly worked on 1.12.2 mods for my own amusement so I think my knowledge is outdated. Any help/direction on what to do would be stellar. A picture of the GUI I want to retexture:
  14. Hello, guys! I'm creating a mod that includes a machine. This machine has 4 slots: 2 input slots and 2 output slots. For this machine to work, it needs two things: 2 valid items in the input slots, and it requires that the player clicks on the "uncraft" button in the center of the GUI. Then the progress will start. However, I'm not able to make the block entity understand that the button was clicked on the client side. Does anybody know how to implement a GUI button that updates a block entity variable? This is my project: https://github.com/jujulioed/Dukas_Utilities_Mod (in this version, the button interaction was not implemented yet.)
  15. Hi all, I've been updating my mod from 1.18 to 1.19 and so far I've been able to fix the changes regarding literal/translatable Components and other minor changes, but the Button class' constructor seems to have changed, and I don't know how to update it. Here is my working constructor for 1.18: public BuySellButton(int x, int y, String buyText, String sellText, boolean isBuy, OnPress listener) { super(x, y, 50, 12, new TextComponent((isBuy ? buyText : sellText)), listener); this.isBuy = isBuy; } Simply changing the component does not work: public BuySellButton(int x, int y, String buyText, String sellText, boolean isBuy, OnPress listener) { super(x, y, 50, 12, Component.literal((isBuy ? buyText : sellText)), listener); this.isBuy = isBuy; } Cannot resolve method 'super(int, int, int, int, MutableComponent, OnPress)' Here are the available constructors/builders from the Button class: public static Button.Builder builder(Component p_254439_, Button.OnPress p_254567_) { return new Button.Builder(p_254439_, p_254567_); } protected Button(int p_259075_, int p_259271_, int p_260232_, int p_260028_, Component p_259351_, Button.OnPress p_260152_, Button.CreateNarration p_259552_) { super(p_259075_, p_259271_, p_260232_, p_260028_, p_259351_); this.onPress = p_260152_; this.createNarration = p_259552_; } protected Button(Builder builder) { this(builder.x, builder.y, builder.width, builder.height, builder.message, builder.onPress, builder.createNarration); setTooltip(builder.tooltip); // Forge: Make use of the Builder tooltip } Can someone please help me understand how to update my Button constructor?
×
×
  • Create New...

Important Information

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