Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 :)

  • Author

and how can I show this timer on the display? Sorry but please explain the things better Im an beginner. 

Edited by StrangePerson

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 by Luis_ST

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.

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.

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.