Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Creater Speedrun Timer (1.18)


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

2 minutes ago, warjort said:

I mean the event supports different element types of the gui, ALL, BOSS, TEXT, etc.

Yes. For the purposes of adding to the HUD only ALL is relevant.

3 minutes ago, warjort said:

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.

Which has nothing to do with adding an element to the HUD. Also, RGOE.PreLayer fires for all elements, allowing you to cancel individual elements still.

Link to comment
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

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