Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Minecraft Hacks & Cheats › Minecraft Tutorials › Efficient Text GUI Using Loops

CoolEfficient Text GUI Using Loops

Posts 1–3 of 3 · Page 1 of 1
infexious
infexious
Efficient Text GUI Using Loops
Hey guys, today I'm going to present a simpler and more efficient way to go about displaying a text gui (for all of you out there that still use them).
Normally, you'd see that lots of people like to use something like this:
Code:
if (GuiHacks.fly) {
    fontrenderer.drawStringWithShadow("F: Fly", 2, 12, 0xff0000);
} else fontrenderer.drawStringWithShadow("F: Fly", 2, 12, 0xffff00);

if (GuiHacks.nofall) {
    fontrenderer.drawStringWithShadow("N: Nofall", 2, 12, 0xff0000);
} else fontrenderer.drawStringWithShadow("N: Nofall", 2, 12, 0xffff00);
Now this is fine, but it can get quite tedious (plus it looks tacky) to add that for every one of your hacks. So instead you'd would want to find a way to draw them with only a short amount of code -- loops! In this case, the 'for' loop is your friend. So let's make a couple of arrays.
You're going to need two arrays; one for the booleans and one for the strings. So go ahead and set up the arrays in this fashion:
 
CODE
Code:
boolean[][] guiHacksBool = {
    { //"page" 1
        hackFlyDetected,
        hackNofall,
        hackHighJump
    },
    { //"page" 2
        hackGuitar,
        hackUndetectedFly,
        hackLOL
    }
};

String[][] guiHacksStr = {
    { //"page" 1
        "F: Fly (Detected)",
        "N: No Fall",
        "J: High Jump"
    },
    { //"page" 2
        "G: Guitar",
        "X: Fly (Undetected)",
        "L: LOL"
    }
}


Remember, that you're also going to have to initialize those lists in the class before you actually start using them.
Okay; so now you probably see where I'm going at (hopefully) with these two lists. The first one holds the booleans and the second one holds the text that is to be drawed on the screen if that said boolean be true. Let's take a look at the loop code:
Code:
for (int p=0;p<guiHacksBool[showHackGUICurrentPage].length;p++) {
    if (guiHacksBoolean[guiPage][p]) {
        fontrenderer.drawStringWithShadow(guiHacksStr[guiPage][p], 2, 12+p*10, 0x00ff00);
    } else {
        fontrenderer.drawStringWithShadow(guiHacksStr[guiPage][p], 2, 12+p*10, 0xff0000);
    }
}
If you study the code above, you'll soon realize that it's pretty simple. You set it up so that it cycles through the boolean list and then draws the matching string. In this case, 'guiPage' is a declared int that lets you know what "page" you're on in the arrays. I suggest adding a key toggle to add/subtract this value.

Well, that's pretty much the main idea. A tip: again, make sure to initialize the list (preferably by a different name as a final) so that you can access it by a key toggle (like that guiPage incrementer/decrementer). But you still have to leave the previous declaration so that your booleans don't always return their initial value.

I commend all who took their time to read through this tutorial because I enjoyed writing this. Good luck!
#1 · edited 14y ago · 14y ago
InCapacitated
InCapacitated
We would like to see a result screen shot, please put one.
Thanks.
#2 · 14y ago
JonathaN-QQ
JonathaN-QQ
thx thx thx thx
#3 · 14y ago
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

  • Injectors download + How to use a .dll file[Video and Text]By Drake in Combat Arms Europe Hacks
    115Last post 6y ago
  • Fonts and text colour people useBy DoubleDutch in General
    22Last post 16y ago
  • How to make a GUI (.exe) trainer using cheat engineBy iJustHelp in Call of Duty Modern Warfare 2 Tutorials
    8Last post 16y ago
  • [iDevices]How To Use MPGH Mobile Efficiently!By Justin in General
    14Last post 15y ago
  • Trans Spam (customizable/GUI/easy use)By DanK in Vindictus Hacks & Cheats
    38Last post 15y ago

Tags for this Thread

#client#easy#efficient#gui#minecraft#text