Posted July 8, 20223 yr Hey, I want a mod that starts a timer when I run an Command and Teleports Player with a given team (Ingame Scoreboard) to fix coordinates. I know things like that are easier with a plugin but I need a mod for that. I don´t know how to do that best so pls help me... (you can also help me if you only give me an example code for a timer or explain how to best make the timer. the other things don't have to be, maybe i could even do it myself). Thank you
July 8, 20223 yr Author and how can I show this timer on the display? Sorry but please explain the things better Im an beginner. Edited July 8, 20223 yr by StrangePerson
July 8, 20223 yr render it on the Screen using a IIngameOverlay, you can draw the timer using Font#draw, (Edit) would be one option you could choose Edited July 8, 20223 yr by Luis_ST
July 8, 20223 yr You can register for the RenderGameOverlayEvent (Pre or Post) in your FMLClientSetupEvent. In the event draw whatever you like. Maybe you can look at ForgeInGameGui.renderHudText() for how it draws a list of messages. The event fires multiple times, but I would guess you probably want the Post event and check for ElementType.ALL before drawing? YMMV If you want to play nice, you should also check Minecraft.getInstance().options.hideGui Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
July 8, 20223 yr Quote If you want to play nice, you should also check Minecraft.getInstance().options.hideGui Forget that, it actually checks that before calling your method. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
July 8, 20223 yr Quote OverlayRegistry should be used for new HUD elements instead of the event. That looks to be called in the same place as Post/ElementType.ALL Except you register an IIngameOvelay with the OverlayRegistry instead of using an event. So I guess the event is still needed for other ElementTypes? Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
July 8, 20223 yr I mean the event supports different element types of the gui, ALL, BOSS, TEXT, etc. The OverlayRegistry is only used where it does ElementType.ALL Also the event supports Pre and Post while the OverlayRegistry is just "Post". Which means the event supports cancellation of the drawing of that element altogether via a Pre handler. But that's getting off-topic. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
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.