Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • (Solved) [1.12.2] Event for world load
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
the4naves

(Solved) [1.12.2] Event for world load

By the4naves, July 4 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

the4naves    0

the4naves

the4naves    0

  • Tree Puncher
  • the4naves
  • Members
  • 0
  • 11 posts
Posted July 4 (edited)

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 July 5 by the4naves
Solved
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45584 posts
Posted July 5

Why do you need this? Why can you not use WorldEvent.Load?  Why do you need Minecraft#world to be set?

  • Quote

Share this post


Link to post
Share on other sites

the4naves    0

the4naves

the4naves    0

  • Tree Puncher
  • the4naves
  • Members
  • 0
  • 11 posts
Posted July 5

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.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45584 posts
Posted July 5

I don't think there is an event for replacing the World instance.

  • Quote

Share this post


Link to post
Share on other sites

the4naves    0

the4naves

the4naves    0

  • Tree Puncher
  • the4naves
  • Members
  • 0
  • 11 posts
Posted July 5

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.

  • Quote

Share this post


Link to post
Share on other sites

the4naves    0

the4naves

the4naves    0

  • Tree Puncher
  • the4naves
  • Members
  • 0
  • 11 posts
Posted July 5

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.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • yegor
      [1.12.2] Transparent armor not rendering properly.

      By yegor · Posted 1 hour ago

      In my mod I have transparent armor which I created with an "ArmorSlime" class, which extends ItemArmor. The item texture for my armor is slightly transparent and it renders correctly, even in item frames.   The armor model uses a slightly transparent texture, which works on the player model, but when I place the armor on an armor stand, it is rendered fully opaque.   Is this a mod issue, or an issue with minecraft itself? Is there a solution?  
    • yegor
      moving topic to just modding support

      By yegor · Posted 1 hour ago

      Moved
    • J0WAY
      [1.12.2] How do i make it so my sword renders in my mobs hand?.

      By J0WAY · Posted 1 hour ago

      Okay, But my main problem is why won't my sword spawn on my mob because i did just change it to the vanilla code and it still doesn't work.  
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 3 hours ago

      https://github.com/thedarkcolour/Future-MC/tree/1.14
    • Draco18s
      [1.14] layout of a modpack

      By Draco18s · Posted 4 hours ago

      I'm pretty sure I've left some comments on his videos about the mistakes he's perpetuating, but its not like anyone reads those.
  • Topics

    • yegor
      0
      [1.12.2] Transparent armor not rendering properly.

      By yegor
      Started 1 hour ago

    • yegor
      0
      moving topic to just modding support

      By yegor
      Started 1 hour ago

    • J0WAY
      2
      [1.12.2] How do i make it so my sword renders in my mobs hand?.

      By J0WAY
      Started 6 hours ago

    • thedarkcolour
      15
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour
      Started 21 hours ago

    • JetCobblestone
      4
      [1.14] layout of a modpack

      By JetCobblestone
      Started 9 hours ago

  • Who's Online (See full list)

    • AtlasTheFirst
    • J0WAY
    • darielernesto11
    • DaemonUmbra
    • Jvramegared
    • Altimus
    • Kermos_the_Wise
    • xieao
    • thedarkcolour
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • (Solved) [1.12.2] Event for world load
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community