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

Hi, i want to activate a press event (like left or right mouse click) using a command in my mod.

example "code"

public void exampleFunction{
   if(condition){
       leftMouseClick();
   }else if(condition2){
       pressH();
   }else{
       rightMouseClick();
   }
}

I have a good java experience, but a very little experience for making mod (i'v only make a tutorial mod).

Anyone can help me?

If you are working on a client side mod the Minecraft class is your way to go.

It has two methods "rightClickMouse" , and "clickMouse". You are free to guess what they do.

The methods are private, so you need to use reflection to call them

  • Author

How i find this 2 methods? You can post me an example?

I didn't know what is and how to use "reflection"  :-[

1.1. IDE "Search" tool. You HAVE TO learn to use it.

1.2. Reading source (yes, MC source and callbacks).

 

2. Pretty much: https://docs.oracle.com/javase/tutorial/reflect/

More on google.

Point of interest (regarding moddig): ObfuscationReflectionHelper.

1.7.10 is no longer supported by forge, you are on your own.

How i find this 2 methods? You can post me an example?

I didn't know what is and how to use "reflection"  :-[

 

I already told you how to find them. They are in the minecraft class. If you are inside the class u can use Strg+F to search

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.