Jump to content
  • Home
  • Files
  • Docs
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] GuiInitEvent not firing
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
WARDOGSK93

[SOLVED] GuiInitEvent not firing

By WARDOGSK93, March 31, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

WARDOGSK93    7

WARDOGSK93

WARDOGSK93    7

  • Stone Miner
  • WARDOGSK93
  • Forge Modder
  • 7
  • 81 posts
Posted March 31, 2018 (edited)

Could anyone tell me why this event is not firing?

Im wanting to modify and add a button to a gui, which i know how to do in 1.7.10 but 1.12.2 the method i use doesnt seem to work :(

 

ive tried using both the Mod.EventBusSubscriber annotation and manually registering in mods preInit

 

the System.out never prints

Using System.out as a test, was using my logger but that wasnt printing so changed to System.out to see if my logger wasnt working but that wasnt the case

 

@Mod.EventHandler public final void onFMLPreInitializationEvent(FMLPreInitializationEvent event)
{
    logger = event.getModLog();

    GuiEventHandler eventHandler = new GuiEventHandler();

    FMLCommonHandler.instance().bus().register(event);
    MinecraftForge.EVENT_BUS.register(event);
}

 

3JGeYZO.png

Edited March 31, 2018 by WARDOGSK93
SOLVED
  • Quote

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
Posted March 31, 2018

Depending on how you do the event subscribing, the method can need to be static. Draco18s knows the details and can explain better. But basically trying making your method static.

  • Quote

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Share this post


Link to post
Share on other sites

WARDOGSK93    7

WARDOGSK93

WARDOGSK93    7

  • Stone Miner
  • WARDOGSK93
  • Forge Modder
  • 7
  • 81 posts
Posted March 31, 2018 (edited)
14 minutes ago, jabelar said:

Depending on how you do the event subscribing, the method can need to be static. Draco18s knows the details and can explain better. But basically trying making your method static.

 

27 minutes ago, WARDOGSK93 said:

ive tried using both the Mod.EventBusSubscriber annotation and manually registering in mods preInit

 


@Mod.EventHandler public final void onFMLPreInitializationEvent(FMLPreInitializationEvent event)
{
    logger = event.getModLog();

    GuiEventHandler eventHandler = new GuiEventHandler();

    FMLCommonHandler.instance().bus().register(event);
    MinecraftForge.EVENT_BUS.register(event);
}

 

 

 

EDIT: Making the method static didnt work either, for both methods of registering event handler

Edited March 31, 2018 by WARDOGSK93
making method static didnt work
  • Quote

Share this post


Link to post
Share on other sites

WARDOGSK93    7

WARDOGSK93

WARDOGSK93    7

  • Stone Miner
  • WARDOGSK93
  • Forge Modder
  • 7
  • 81 posts
Posted March 31, 2018

SOLVED: Dont know how or what changed but it randomly started working, only thing ive changed is method is now static, but that didnt seem to fix it for a min, but it now works randomly lol

  • 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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Use ${} in mods.toml

      By diesieben07 · Posted just now

      Correct.
    • diesieben07
      [1.16.*] Run Client/Server error

      By diesieben07 · Posted 1 minute ago

      If you get that error you are using Java 15 still. However Forge has a recent update that should fix this.
    • diesieben07
      Party System

      By diesieben07 · Posted 1 minute ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      [1.16.4] How i can open a container by clicking on my mob

      By diesieben07 · Posted 2 minutes ago

      Here you write the entity ID. Now you need to read it in your IContainerFactory.   That extraDataWriter stuff doesn't work and makes no sense.
    • Discult
      Party System

      By Discult · Posted 44 minutes ago

      Hello, I am looking for guidance on the best approach to creating a party system I already have the backbone and a system working with commands but I am looking to attach this to a ui(just finished making) so I am looking for advice on the best way to do this going forward, I assume packets will play a big part in the communication to so I can get access to EntityPlayerMP as I believe for the client its EntityClientPlayerMP, So I have a couple of functions that handle it all :  createParty(EntityPlayerMP player); joinParty(EntityPlayerMP player, int inviteIdentifier); inviteParty(EntityPlayerMP sender, EntityPlayerMP invitedPlayer);   Will I need to create different packets and messages for each of these ? if so my idea for the inviteParty is to send over the invitedPlayer uuid but how do I then receive the the player from the current Minecraft server?   Any information will be appreciated.   Regards, Discult
  • Topics

    • DoctorC
      7
      Use ${} in mods.toml

      By DoctorC
      Started 2 hours ago

    • Luis_ST
      1
      [1.16.*] Run Client/Server error

      By Luis_ST
      Started 56 minutes ago

    • Discult
      1
      Party System

      By Discult
      Started 44 minutes ago

    • Klarks
      35
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started Saturday at 09:56 PM

    • Luis_ST
      19
      [1.16.4] Edit Conversion Progress of Zombie Villager (Help with Java Reflection)

      By Luis_ST
      Started 5 hours ago

  • Who's Online (See full list)

    • diesieben07
    • Klarks
    • Luis_ST
    • Thorius
    • Pl00py_R
    • Dragrise96
    • S-Spirit
    • loordgek
    • CookieLukas
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [SOLVED] GuiInitEvent not firing
  • Theme

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