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

Long story short, for a project I'm currently working on, I need a forge event (or something similar) that I can hook into, that fires when a world is loaded, specifically after the "world" variable in net.minecraft.client.Minecraft has been set to something other than null.

Note that because of that last requirement, WorldEvent.Load doesn't work, as "world" hasn't been set yet. The same problem exists with WorldEvent.CreateSpawnPosition.

Does anyone know of some sort of event I can utilize?

Edited by the4naves
Solved

  • Author

It was actually for the other post I made a little while ago, basically I needed to replace the instance of WorldClient with my own, to change which chunks Minecraft tries to load, and where it displays them (While keeping most compatibility with any mods that used WorldClient or the classes it itself uses).

You hadn't replied in a while, which I thought might have been since I worded my last post in a way that from a glance, made it sound as if I had found a solution, so I thought I'd open a thread with the new specific problem I was having, simplified, so that people might more easily understand it.

  • Author

Oh, I don't need something specific for that, I just need any event that occurs just after the world has been loaded, it's okay if there isn't one though, I can probably just use onChunkLoad and just check if I've already run my code, it's just a bit messy.

  • Author

Ok, at least for now, I've found a solution that seems to work pretty well; I'm using EntityJoinWorldEvent, then checking if the entity is an instance of EntityPlayer, and if the event's world is remote, it's a bit messy, but it works.

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.