Jump to content

[Solved] [1.14.4] Some event methods do not trigger


Recommended Posts

Posted (edited)
@Mod.EventBusSubscriber(modid = Reference.MOD_ID)
public class Eventlistener {

    @SubscribeEvent
    public static void onRenderGui(GuiOpenEvent event) {
        if(event.getGui() instanceof EditSignScreen) {
            if(Keybinds.noSignGui.isKeyDown()) {
                event.setCanceled(true);
            }
        }
    }
    
    @SubscribeEvent
    public static void onRightClickEmpty(PlayerInteractEvent.RightClickEmpty event) {
        System.out.println("Empty event");
    }

    @SubscribeEvent
    public static void onRightClicked(PlayerInteractEvent.RightClickBlock event) {
        System.out.println("Right click block");
    }
}

 

The first method onRenderGui(GuiOpenEvent event) does trigger correctly, but I cannot seem to get the other two to trigger, no matter what I do.

I tried having it as an object method and registrering it manually, I've tried registering the class with static methods manually, and I've tried the above.

Edited by Angercraft
Solved
Posted
1 hour ago, kaydogz said:

Try adding bus=Mod.EventBusSubscriber.Bus.FORGE to your class annotation.

That bus is default, it does not need to be specified.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
14 hours ago, Angercraft said:

The first method onRenderGui(GuiOpenEvent event) does trigger correctly, but I cannot seem to get the other two to trigger, no matter what I do.

What version of forge do you have? Is it really old, have you tried updating?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
5 hours ago, Animefan8888 said:

What version of forge do you have? Is it really old, have you tried updating?

I'm using the recommended 1.14.4 - 28.1.0.

I just tried with the latest 1.14.4 - 28.1.17, and the problem seems to be fixed now.

It probably fixed it, by reimporting the Gradle project, so I will keep that in mind next time.

 

Thank you for your help!

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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