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

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.

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.

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

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.